You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jim Frederic <ji...@isogen.com> on 2003/08/25 23:19:57 UTC

ActionLink in Table results in StaleLinkException when caching is disabled

I have a page using a contrib:Table which I've modeled on the Table page 
in the Workbench sample app.  It uses a custom component for 
tableValues.  This custom tableValues is pretty much the same as the 
standard TableValues, but with the rendered value wrapped in an 
ActionLink.  The result is a table of links.  The curious thing is that 
it works EXCEPT when I set org.apache.tapestry.disable-caching.  In that 
case, clicking the links gives me a StaleLinkException, with a message 
saying that the ActionId of the link I clicked maps to a different 
component.

The fact that it only fails when caching is disabled makes me suspect 
something in the way table state is recorded.  For now I've replaced the 
ActionLinks with DirectLinks and the problem is solved, but I'd still 
like to understand what was going on.  Can anyone give me an idea why a 
contrib:Table with ActionLinks would break when caching is disabled?

Thanks,
-Jim


Re: ActionLink in Table results in StaleLinkException when caching is disabled

Posted by Jim Frederic <ji...@isogen.com>.
mb, thanks.  For now I've worked around the problem by using DirectLinks 
instead of ActionLinks, so the rewind is irrelevant.  Let me know if my 
investigating this further will help you out, though.

-Jim

Mindbridge wrote:

>Hi Jim,
>
>The problem in your case, I think, is that there is a difference in the
>TableModels during the render and the following rewind (when the ActionLink
>is invoked). The forms generated are thus different, the Form component
>notices the difference and throws the StaleLink exception.
>
>As it happens, I am just working on versions of the components that use
>ListEdit, etc. and will eliminate this problem completely. They are not
>ready yet though -- there are a few issues that need to be resolved.
>Hopefully, they would be ready for the next beta.
>
>In the mean time, please see if you could make sure that the TableModels
>during the render and rewind could be made identical. If there are, are
>there any other components within the Form that could create a difference?
>(e.g. a Conditional). This situation is actually likely if you happen to
>have properties that are not reinitialized during pageDetach() or
>initialize() -- that will make them keep their old values if they are
>cached, but reset them when disable-caching is used.
>
>If none of the above appears to be the culprit, please send the code -- we
>will try to determine the problem.
>
>Best regards,
>-mb
>
>
>----- Original Message ----- 
>From: "Jim Frederic" <ji...@isogen.com>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Tuesday, August 26, 2003 12:19 AM
>Subject: ActionLink in Table results in StaleLinkException when caching is
>disabled
>
>
>  
>
>>I have a page using a contrib:Table which I've modeled on the Table page
>>in the Workbench sample app.  It uses a custom component for
>>tableValues.  This custom tableValues is pretty much the same as the
>>standard TableValues, but with the rendered value wrapped in an
>>ActionLink.  The result is a table of links.  The curious thing is that
>>it works EXCEPT when I set org.apache.tapestry.disable-caching.  In that
>>case, clicking the links gives me a StaleLinkException, with a message
>>saying that the ActionId of the link I clicked maps to a different
>>component.
>>
>>The fact that it only fails when caching is disabled makes me suspect
>>something in the way table state is recorded.  For now I've replaced the
>>ActionLinks with DirectLinks and the problem is solved, but I'd still
>>like to understand what was going on.  Can anyone give me an idea why a
>>contrib:Table with ActionLinks would break when caching is disabled?
>>
>>Thanks,
>>-Jim
>>
>>
>>---------------------------------------------------------------------
>>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: ActionLink in Table results in StaleLinkException when caching is disabled

Posted by Mindbridge <mi...@yahoo.com>.
Hi Jim,

The problem in your case, I think, is that there is a difference in the
TableModels during the render and the following rewind (when the ActionLink
is invoked). The forms generated are thus different, the Form component
notices the difference and throws the StaleLink exception.

As it happens, I am just working on versions of the components that use
ListEdit, etc. and will eliminate this problem completely. They are not
ready yet though -- there are a few issues that need to be resolved.
Hopefully, they would be ready for the next beta.

In the mean time, please see if you could make sure that the TableModels
during the render and rewind could be made identical. If there are, are
there any other components within the Form that could create a difference?
(e.g. a Conditional). This situation is actually likely if you happen to
have properties that are not reinitialized during pageDetach() or
initialize() -- that will make them keep their old values if they are
cached, but reset them when disable-caching is used.

If none of the above appears to be the culprit, please send the code -- we
will try to determine the problem.

Best regards,
-mb


----- Original Message ----- 
From: "Jim Frederic" <ji...@isogen.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, August 26, 2003 12:19 AM
Subject: ActionLink in Table results in StaleLinkException when caching is
disabled


> I have a page using a contrib:Table which I've modeled on the Table page
> in the Workbench sample app.  It uses a custom component for
> tableValues.  This custom tableValues is pretty much the same as the
> standard TableValues, but with the rendered value wrapped in an
> ActionLink.  The result is a table of links.  The curious thing is that
> it works EXCEPT when I set org.apache.tapestry.disable-caching.  In that
> case, clicking the links gives me a StaleLinkException, with a message
> saying that the ActionId of the link I clicked maps to a different
> component.
>
> The fact that it only fails when caching is disabled makes me suspect
> something in the way table state is recorded.  For now I've replaced the
> ActionLinks with DirectLinks and the problem is solved, but I'd still
> like to understand what was going on.  Can anyone give me an idea why a
> contrib:Table with ActionLinks would break when caching is disabled?
>
> Thanks,
> -Jim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org