Hi Filip,

I'm just a little confused with persist and default value, I think what we
instantiated/assigned in the padedLoaded are considered default value and it
will be used by T5 to reset private variables in the page, am I right?

This does bring up another topic, what is the best practice to create maps
for different Selects in a page? I'd prefer to set it up in the pageLoaded,
so that all users accessing same page does not have to incur the cost of
assignment again, is this a right assumption? Thanks,

A.C.


Filip S. Adamsen-2 wrote:
> 
> Hi Angelo,
> 
> pageLoaded is only executed when the page is first instantiated and 
> configured.
> 
> I think you might want to use pageAttached instead, which is executed 
> every time the page is attached to a new request.
> 
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/lifecycle.html
> 
> -Filip
> 
> Angelo Chen skrev:
>> Hi,
>> 
>> One thing confuses me, here is a sample code:
>> 
>>  private Map<String, String> countryList;
>> 
>>  @Inject private DBServices dbServices;
>> 
>>   void pageLoaded() {
>>         countryList = dbServices.getCountryList();
>> 
>> without any Persist annotation, the countryList is persisted between
>> requests. if I move the above line to the constructor of the page class,
>> it
>> has the same result. why?
>> 
>> A.C.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Map-and-persistency-tf4931665.html#a14122452
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to