This content has been marked as final.
Show 3 replies
-
1. Re: @Factory method get called first..
monkeyden May 18, 2007 11:11 AM (in response to m.shinde)You're not doing anything wrong. This is just the way it behaves. I'm sure there is a lot more which happens but most basically it's this:
1. The commandButton initiates the request
2. Seam creates the component, if it doesn't exist
3. Performs any and all injection for the component
4. Those data members which have factory methods associated, Seam invokes the methods
5. If a @Create method is defined, Seam calls it
6. The originally requested action method is invoked. -
2. Re: @Factory method get called first..
m.shinde May 18, 2007 11:26 AM (in response to m.shinde)Means there is know way to get filtered records from Factory method...
Do u have any another solution for this situation. -
3. Re: @Factory method get called first..
monkeyden May 18, 2007 11:37 AM (in response to m.shinde)Not when that filter needs to be injected. I don't know the specific requirement but if it exists already, you could get it explicitly in the factory method.
@Factory("mainformList") public List getMainFormData() { Context session = Contexts.getSessionContext(); Object obj = sesison.get("myFilter"); }
or look it up in the DB:@Factory("mainformList") public List getMainFormData() { MyBO bo = new MyBO(); bo.findByName("myFilter"); }
...or get it from wherever else it might originate.