You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kevin Menard <ni...@negativetwenty.net> on 2005/03/06 23:45:09 UTC

Dynamic Form Issue

Hi,

As a follow up to my message last night, I just created selection
models for countries and states/provinces (I'll add these to Tassel
when I clean them up a bit).  What I'd like to do is for countries
that I know the provinces for, show a PropertySelection with the
provinces.  For those countries that I don't know the provinces for,
I'd like to display a TextField for entry.  To accomplish this, I have
the country PropertySelection submit on change.  A conditional is used
to show either the province PropertySelection or TextField.  The
problem obviously comes when the new component replaces the old one,
which causes a stale link exception when the form rerenders.  Any
thoughts on what I ought to do to get around this?

Thanks,
Kevin


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


Re: Dynamic Form Issue

Posted by Kent Tong <ke...@cpttm.org.mo>.
Hanson Char <hanson.char <at> gmail.com> writes:

> I posted the following earlier in relation to the use of a
> "LenientForm" component instead of the built-in Form component to
> allow more flexibility in handling StaleLinkException.  Hope it helps.

It doesn't look like a solution to the problem. Tapestry
is trying to tell you something is wrong but this component 
is trying to make it shut up.



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


Re: Dynamic Form Issue

Posted by Hanson Char <ha...@gmail.com>.
I posted the following earlier in relation to the use of a
"LenientForm" component instead of the built-in Form component to
allow more flexibility in handling StaleLinkException.  Hope it helps.

H

"One attempted general solution to this issue is to simply have a
drop-in replacement of  the Tapestry Form component with something I
call a "LenientForm" component.  A LenientForm is exactly the same as
a Form except in the renderComponent method.  Instead of throwing up
the StaleLinkException, it saves it as a
"FormRewindStaleLinkException", a simple subclass of
StaleLinkException, in the request attributes and moves on as if the
exception never arised.

Now when the thread comes to execute the page object's listener
method, the listener can then check from the request attributes
whether there exists a StaleLinkException during the form rewind, and
if so deal with it in whatever way it makes sense (including either
throwing it up or ignoring it).  At the very least the page can now
have the option of displaying a customized stale page to the user,
instead of giving them a stack trace."


On Sun, 6 Mar 2005 17:45:09 -0500, Kevin Menard
<ni...@negativetwenty.net> wrote:
> Hi,
> 
> As a follow up to my message last night, I just created selection
> models for countries and states/provinces (I'll add these to Tassel
> when I clean them up a bit).  What I'd like to do is for countries
> that I know the provinces for, show a PropertySelection with the
> provinces.  For those countries that I don't know the provinces for,
> I'd like to display a TextField for entry.  To accomplish this, I have
> the country PropertySelection submit on change.  A conditional is used
> to show either the province PropertySelection or TextField.  The
> problem obviously comes when the new component replaces the old one,
> which causes a stale link exception when the form rerenders.  Any
> thoughts on what I ought to do to get around this?
> 
> Thanks,
> Kevin
> 
> ---------------------------------------------------------------------
> 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: Dynamic Form Issue

Posted by Kevin Menard <ni...@negativetwenty.net>.
Hi Kent,

On Mar 6, 2005, at 8:30 PM, Kent Tong wrote:

> Use a FormConditional comopnent instead of a Conditional.

Nifty, I was unaware of this component.  I had to do something a bit 
funky to get it to work, but it's all working now.

Thanks,
Kevin


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


Re: Dynamic Form Issue

Posted by Kent Tong <ke...@cpttm.org.mo>.
Kevin Menard <nirvdrum <at> negativetwenty.net> writes:

> The problem obviously comes when the new component replaces the old one,
> which causes a stale link exception when the form rerenders.  Any
> thoughts on what I ought to do to get around this?

Use a FormConditional comopnent instead of a Conditional.



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