Hi,

I am struggling a bit with initializing a persisted property of a component

I need something like this:
<property-specification name="userStoryFilter" type="com.nordija.planb.domain.util.UserStoryFilter" initial-value="new com.nordija.planb.domain.util.UserStoryFilter() " persistent="yes"/> Except that the effect of initial-value is that it will be initialized everytime the page the component is contained inside is put back into the page pool.

I need to do a initialize once.

I have tried manually by writing:
protected void prepareForRender(IRequestCycle cycle) {
 if (getUserStoryFilter() == null) {
   setUserStoryFilter(new UserStoryFilter());
 }
 super.prepareForRender(cycle);
}

But it generates a runtimeexception:
Page recorder for page MyPage is locked after a commit(), but received a change to property userStoryFilter of component MyPage/myComponent.

Do you have any suggestions on how to initialize a persisted property the first time the component is rendered on a specific page?

I'm using Tapestry 3.0.3.

Regards
Jacob von Eyben


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to