You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Radim Burget <Ra...@seznam.cz> on 2005/08/24 22:53:48 UTC

Re: persistent property problem

I am not shure if I undertand you right but....

>Hello All!
>Something strange is going on...
>
>I declare persistent property in page spec:
>
>  <property name="queryFilter" persist="session" initial-value="hivemind:spring:studentFilter" />
>
>But after page reload, this persistent property obtains NEW value.
>(Page instance is the same)
>
>But it is session-persistent it shouldn't be re-inited.
>Am I wrong?
>
>I debugged and find out that property value is changed in
>AbstractPage.firePageDetached()
>  
>Used:
>Tapestry-4.0-beta-4,
>-Dorg.apache.tapestry.disable-caching=false
>
>Thank you, Alex
>
>
>
>---------------------------------------------------------------------
>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


Re[2]: persistent property problem

Posted by Alexandr Kundirenko <ak...@gmail.com>.
finishLoad() works fine for me, thank you a lot!

HLS> The property is not persistent until it is changed.

HLS> What Tapestry is doing is creating  a binding from the initial-value
HLS> attribute, "hivemind:spring:studentFilter".

HLS> Inside finishLoad(), and again inside pageDetached(), the binding is
HLS> evaluated and the result stored into the property's instance variable.

HLS> This represents a subtle change in behavior from 3.0.

HLS> In 3.0, the initial-value was used to set the initial value of the
HLS> property when the page is first created.  The property is then read
HLS> and stored as is, and that exact value is used to reset the property
HLS> at the end of the request.

HLS> To duplicate that behavior, you should not use initial-value; instead,
HLS> override the finishLoad() method and initialize your property there.
HLS> Uses this approach yields the same behavior as 3.0 (if you look with
HLS> the debugger, you'll see that there's two different instance variables
HLS> for the property, one stores the default value, the other the active
HLS> value).

HLS> On 8/24/05, Radim Burget <Ra...@seznam.cz> wrote:
>> I am not shure if I undertand you right but....
>> 
>> >Hello All!
>> >Something strange is going on...
>> >
>> >I declare persistent property in page spec:
>> >
>> >  <property name="queryFilter" persist="session"
>> initial-value="hivemind:spring:studentFilter" />
>> >
>> >But after page reload, this persistent property obtains NEW value.
>> >(Page instance is the same)
>> >
>> >But it is session-persistent it shouldn't be re-inited.
>> >Am I wrong?
>> >
>> >I debugged and find out that property value is changed in
>> >AbstractPage.firePageDetached()
>> >
>> >Used:
>> >Tapestry-4.0-beta-4,
>> >-Dorg.apache.tapestry.disable-caching=false
>> >
>> >Thank you, Alex
>> >
>> >
>> >
>> >---------------------------------------------------------------------
>> >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
>> 
>> 





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


Re: persistent property problem

Posted by Howard Lewis Ship <hl...@gmail.com>.
The property is not persistent until it is changed.

What Tapestry is doing is creating  a binding from the initial-value
attribute, "hivemind:spring:studentFilter".

Inside finishLoad(), and again inside pageDetached(), the binding is
evaluated and the result stored into the property's instance variable.

This represents a subtle change in behavior from 3.0.

In 3.0, the initial-value was used to set the initial value of the
property when the page is first created.  The property is then read
and stored as is, and that exact value is used to reset the property
at the end of the request.

To duplicate that behavior, you should not use initial-value; instead,
override the finishLoad() method and initialize your property there.
Uses this approach yields the same behavior as 3.0 (if you look with
the debugger, you'll see that there's two different instance variables
for the property, one stores the default value, the other the active
value).

On 8/24/05, Radim Burget <Ra...@seznam.cz> wrote:
> I am not shure if I undertand you right but....
> 
> >Hello All!
> >Something strange is going on...
> >
> >I declare persistent property in page spec:
> >
> >  <property name="queryFilter" persist="session" initial-value="hivemind:spring:studentFilter" />
> >
> >But after page reload, this persistent property obtains NEW value.
> >(Page instance is the same)
> >
> >But it is session-persistent it shouldn't be re-inited.
> >Am I wrong?
> >
> >I debugged and find out that property value is changed in
> >AbstractPage.firePageDetached()
> >
> >Used:
> >Tapestry-4.0-beta-4,
> >-Dorg.apache.tapestry.disable-caching=false
> >
> >Thank you, Alex
> >
> >
> >
> >---------------------------------------------------------------------
> >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
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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