This content has been marked as final.
Show 5 replies
-
1. Re: h:commandLink behaviour - decode, encode
msznapka Aug 15, 2007 3:06 AM (in response to msznapka)I forget my configuration:
jboss-seam-2.0.0.BETA1
jboss-4.2.0.GA
facelets-1.1.13 -
2. Re: h:commandLink behaviour - decode, encode
pmuir Aug 15, 2007 5:00 AM (in response to msznapka)This is just the way the JSF lifecycle works. Make sure not to do a lot of work in a getter.
-
3. Re: h:commandLink behaviour - decode, encode
msznapka Aug 15, 2007 5:59 AM (in response to msznapka)Thank you for answer Pete
So you think that loading data from database should be done inside action method (here doSomething)?
What about first page load, where no action was fired?
first page load - getData
action load - getData, action, getData
For information - this is event scoped seam component and data are loaded from database. Such loaded data depends on your action, if no action, than load default data.
So here is code:@Name("event") @Scope(EVENT) public class Event { List<Item> data = null; getData ... return data; setData ... this.data = data; doSomething() { if(linkParameter == null) loadDefaultDataFromDatabase(); else loadDataFromDatabase(linkParameter); } ...
so if you access page for first time, null data are returned, that is why i thought that loading data must be inside getters methods -
4. Re: h:commandLink behaviour - decode, encode
pmuir Aug 15, 2007 6:02 AM (in response to msznapka)This is what @Factory is for.
-
5. Re: h:commandLink behaviour - decode, encode
msznapka Aug 15, 2007 8:13 AM (in response to msznapka)It works, thanks a lot!