This content has been marked as final.
Show 2 replies
-
1. Re: Best practice? - table default values, form with not all entity members
jkronegg Feb 16, 2009 1:39 PM (in response to bobgee)Since your form may be specific to a given .xhtml page, I would add in my xxx.page.xml the following (assuming your form uses the object defined by myEntityHome.instance) :
<action execute="#{myBean.initializeMyDefaultFields(myEntityHome.instance)}"/>
Then add your bean the initializeMyDefaultFields method:
public void initializeMyDefaultFields(MyObject instance) { instance.setMyField("myDefaultValue"); ... }
-
2. Re: Best practice? - table default values, form with not all entity members
bobgee Feb 24, 2009 11:40 AM (in response to bobgee)Gruezi, Julien,
thanks for your hint! I wasn't aware of this possibility.
action -
EL method expression that will be invoked before the page renders
Well, I'm not surely understanding the life cycle.
I want to create the new (persistent?) object on submitting the form not when I render the form for entering data for the new object.
To be sure:
Is that instance from your code fragment the same object that will be persisted on submit?Thanks!
Robert