A few things: -) property-specification is the old 3.0 dtd way of doing things, it should look more like:
<property name="registryCenter" persist="session" /> -) There are two relatively easy ways to provide default values : <property name="registryCenter" persist="session" initial-value="ognl: new ch.mycompany.RegistryCenter()" /> or implement PageBeginRenderListener in your component (the name of the interface is unfortunate as it can be applied to any component - which pages are themselves): from http://tapestry.apache.org/tapestry4.1/usersguide/events.html && http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/event/PageBeginRenderListener.html public void pageBeginRender(PageEvent event) { // initialize your property somehow setRegistryCenter(new RegistryCenter()); } On 5/27/07, Alexander Lamb <[EMAIL PROTECTED]> wrote:
Hello list, I am stuck with something. I have a component which goes through several states. Therefore I need to keep some persistent properties. That's why in the jwc file I have: <property-specification name="registryCenter" type="ch.rodano.role.model.RegistryCenter" persistent="yes" /> However, I need to initialize some of those properties prior to the first rendering of the component. I though I could do it in "prepareForRender(...)" I simply did a "setRegistryCenter(...)" But it didn't work, I got the following message: Persistent properties may only be changed prior to the rendering of the response page. Where can I initialize my properties??? Thanks, -- Alexander Lamb Founding Associate RODANOTECH Sàrl 26 ch des Tattes 1222 Vésenaz Switzerland Fax: 022 855 06 14 http://www.rodanotech.ch
-- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com