You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Régis Piccand <gm...@piccand.com> on 2003/11/22 01:50:47 UTC

Re: (Long...) Transient property not initialized() when a page links to itself in a form?

Hi Harish,

Please see my notes below

Harish Krishnaswamy wrote:
> Taking a quick look at you Admin_customers.java seems like you have some 
> instance variables (sessionStateManager, tableModel, currentRow) that is 
> not cleaned up at the end of the request cycle before returning to the 
> pool. 

That is true. I will have to sort that out properly (declare them in .page). 
However, the one causing the problem is currentCustomer.

Also you have some persistent page properties defined in your
> .page file that will stick around until you call 
> cycle.getEngine().forgetPage(getPageName()) from your page.

True. I want these properties to be persistent. Again, currentCustomer is _not_ 
persistent, but seems however to stick around after the form is submitted...

Maybe this is due to the fact that currentRow is sharing an instance of Customer 
with currentCustomer (currentCustomer = currentRow). As currentRow is not 
cleaned, the instance of Customer remains, and although currentCustomer should 
be cleaned, it may still reference the Customer object that has not been garbage 
collected.

I'll try that tomorrow ...

> 
> -Harish
> 
> Régis Piccand wrote:
> 
>> Hi Harish and Richard,
>>
>> thanks for taking the time to look at this issue.
>>
>> I think that there is a misunderstanding, coming from the name of the 
>> thread. What happens really is that a transient property becomes 
>> persistent after a form submit is done. In the form submit, nothing 
>> else than the current page re-activation. After that, when I go to 
>> another page and come back, the form should be empty, because it 
>> should be initialized with default-value. However it still shows the 
>> last item values. I have prepared and zipped a tiny example with two 
>> pages which shows the problem clearly. You should be able to unzip the 
>> file in your webapp directory and add the following line to server.xml :
>>
>> <Context path="/tapestryForm" docBase="tapestryForm/context" 
>> reloadable="true"/>
>>
>> url will be http://localhost:8080/tapestryForm/app
>>
>> On the first page, click on "To admin console". Click "Rechercher", 
>> then select some of the records by clicking "OK". They are shown in 
>> the form below. If you go "back home" and then "To admin console", the 
>> form is empty (thanks to default-value) where as the searchField and 
>> the results are still there (persistent fields).
>>
>> Now, click again on any of the "OK" link, and edit/modify any of the 
>> field, and submit the form. The form still shows the edited values, 
>> which is fine, as we are still in the same page. Click on any of the 
>> fields, the form changes nicely. Go "Back home" and "To the Console" 
>> ... The form is still filled with the values you edited ... In my 
>> opinion, it should be empty, because initialized with default-value...
>>
>> I wonder if I am missing a big thing or if there is something else ...
>>
>> Thanks a lot for reading ;-)
>>
>> Régis
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 



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