[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-dev
Subject:    Initializing Persistent Property of a component
From:       Kiran Meduri <mkktapestry () gmail ! com>
Date:       2005-04-26 17:16:44
Message-ID: fa40e3480504261016443479d5 () mail ! gmail ! com
[Download RAW message or body]

Hi,
   I have a page which contains a Tabbed Panel. And in one of the tabs
I have a component. This component inturn has 2 more components one
for view mode and one for edit mode. On the viewmode I have a property
for storing a list of items which is persistent. I have to initialize
this list using a function which takes arguments as a value of a
parameter of the component which is bound to a persistent property of
the page (via the parent component parameter).

here is the page file's property spec block

<property-specification name="objA" persistent="yes" type="A"/>  
   
    <component id="parentComponent" type="ParentComponent">
        <binding name="objA" expression="objA"/>        
    </component>


here is the parent component's property spec block

<parameter name="objA" required="yes" direction="in" type="A"/>

    <component id="editComponent" type="EditComponent"> 
         <binding name="objA" expression="objA"></binding>
    </component>
     <component id="viewComponent" type="ViewComponent">
         <binding name="objA" expression="objA"></binding>
     </component>

here is the view component's property spec block

 <parameter name="objA" direction="in" required="yes" type="A"/>

<property-specification name="list" type="java.util.List" 
        persistent="yes" initial-value="new java.util.ArrayList()">
    </property-specification>


In the JAVA file of view component I have a method initializeList()
which can initialize the values after reading from DB.

I have gone through the mailing list and found a solution which says
to call page.setup() methods to initialize properties before activate
which I dont want to do as there is only one page and the value of
objA comes from a different tab (component) on the same page.

Please suggest me of any solution.

--Thanks
mkk

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic