You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Dr. Christian Bacher" <ba...@t-online.de> on 2005/08/01 22:45:59 UTC

Re: Question Stale Links: Solution

hello,
i think the
the solution is the following:

the form component requires that the page is rendered while rewinding
exactly in the same way as rendered before.
otherwise a stale link exception is thrown, even if the form is declared 
stateless.
so if forms are dynamically rendered, and for example  the source does 
not take care of the order
of elements or simply the data changed, then the rewind cycle fails.

well i did not understand that the form is "rendered" twice
one time to render html and a second time after submit  to update 
properties.
 
to be sure to have the exactly same rendering in the second run , the 
data presented by the form can
be saved in the page and if f cycle.isRewinding() is true this data can 
be used for rewinding.


best regards,
christian



> In this case it may help also to use form-friendly components. It 
> helps a lot avoiding form rewind errors if the page itself 
> encapsulates its current state.
> And maybe try to defer submit listener executions (in tap4) if it is 
> possible (although I think it is the default mode).
>
> Br,
> Norbi
>
> ----- Original Message ----- From: "Dr. Christian Bacher" 
> <ba...@t-online.de>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Monday, August 01, 2005 12:07 PM
> Subject: Re: Question Stale Links
>
>
>> Hello,
>>
>>> It depends on your code, mainly how/where you store the current 
>>> state of the components/pages. I mean persistent properties or 
>>> hidden fields, etc.
>>> Check that you use form-friendly components like If/FormConditional, 
>>> etc. where appropriate.
>>
>>
>> i have no persistent properties (i plan to write a completly stateless
>> application where sessions and all statefull things
>> were stored in database layers and their caches, a good test for 
>> clustering ;-) )
>>
>> the form fields are generated from a "state" stored in a database so 
>> i wonder.
>> may i have to make some resetting operations?.
>> the goal is to to have one page with a component which renders the 
>> form using
>> a "@Foreach attribute in currentAttributes" loop.
>> the current attributes are got from a persistent state in the database.
>>
>> so i thought, if i call cycle.activate the form will be rendered 
>> without reminding
>> a previous call. if it is not the case, how can i achieve this 
>> situation?
>>
>>
>> thanx,
>> best regards,
>> christian
>>
>>>
>>> Br,
>>> Norbi
>>>
>>> ----- Original Message ----- From: "Dr. Christian Bacher" 
>>> <ba...@t-online.de>
>>> To: <ta...@jakarta.apache.org>
>>> Sent: Monday, August 01, 2005 11:28 AM
>>> Subject: Question Stale Links
>>>
>>>
>>>> Hello,
>>>> tapestry version 3.0.3
>>>> im getting not desired stale link exceptions in the following way:
>>>> i have created a wizard which has back and forth buttons.
>>>> the forms and links in the wizard are dynamically created.
>>>> if i go back and forth again, a stale link exception occurs.
>>>> how can i avoid this?
>>>> Thanx,
>>>> Christian
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> 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