Re: Help needed for persistent properties initialization in components (4.1.2)
Hello, So if I understand correctly the two answers I received, I should NOT use the initial-value attribute since I will not yet have session information (and probably component parameters). If I need a place to initialize some persistent properties which will be called after the component parameters are set but before the component renders I need to implement pageBeginRender. Alex Le 28 mai 07 à 01:44, Christian Haselbach a écrit : On Sun, May 27, 2007 at 03:02:49PM -0400, Jesse Kuhnert wrote: value="ognl: new ch.mycompany.RegistryCenter()" /> But it is important to keep in mind the semantics of initial-value. It is evaluated when the component is first created and when it _returns_ to the pool (and not when it is fetched from the pool). Hence, if you write an initilization function that uses data from the current session, you will not get what you expect. Regards, Christian -- Christian Haselbach - [EMAIL PROTECTED] - +49 176 2082 5804 TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring Geschäftsführer: Henrik Klagges, Gerhard Müller, Eike Reinel Amtsgericht München, HRB 135082 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alexander Lamb Founding Associate RODANOTECH Sàrl 26 ch des Tattes 1222 Vésenaz Switzerland Fax: 022 855 06 14 http://www.rodanotech.ch
Re: Help needed for persistent properties initialization in components (4.1.2)
On Sun, May 27, 2007 at 03:02:49PM -0400, Jesse Kuhnert wrote: > But it is important to keep in mind the semantics of initial-value. It is evaluated when the component is first created and when it _returns_ to the pool (and not when it is fetched from the pool). Hence, if you write an initilization function that uses data from the current session, you will not get what you expect. Regards, Christian -- Christian Haselbach - [EMAIL PROTECTED] - +49 176 2082 5804 TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring Geschäftsführer: Henrik Klagges, Gerhard Müller, Eike Reinel Amtsgericht München, HRB 135082 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help needed for persistent properties initialization in components (4.1.2)
A few things: -) property-specification is the old 3.0 dtd way of doing things, it should look more like: -) There are two relatively easy ways to provide default values : 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: 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