You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joel Trunick <jo...@webifysolutions.com> on 2004/06/10 21:34:20 UTC

Conditional Form Elements

Did this go anywhere?...

Joel

From: Howard M. Lewis Ship <hl...@attbi.com>
Subject: Conditional Form elements/Stale Link page
Date: Wed, 25 Jun 2003 20:02:56 -0400
Content-Type: text/plain;
	charset="us-ascii"

I was thinking about this on the drive home.

First off: shadow variables.  If you want to have:

<input jwcid="@Checkbox" selected="ognl:a">
<span jwcid="@Conditional" condition="ognl:a">
...
</span>

That's a problem.  When the form rewinds, if the user has clicked the
checkbox, then the content of
the conditional either renders or doesn't ... but doesn't
match the original render.  Fall down, go boom.

Now let's imagine that before we render we set property b to match
property a:

<input jwcid="@Checkbox" selected="ognl:a">
<span jwcid="@Conditional" condition="ognl:b">
...
</span>

b shadows a.  As long as we set b properly before we rewind, then the
rewind will match the original
render, even if the user changes property a.
In the form listener, we update b from a once it is safe.

Thought #1:

How about a FormConditional component?  Similar to the relationship
between Foreach and ListEdit.
On render, the FC reads a, stores it into a hidden field, and renders or
doesn't appropriately.
On rewind, the FC ignores a, reads the stored value, and renders or
doesn't appropriately (matching
the render no matter what).

Thought #2:

Change the Conditional component to do exactly that: if inside a Form
then do what I just described
for FC.

Thought #3:

That's a bigger change than I'm comfortable for in a beta.  I'd still
like to do it, but from a
community sense, I want to put it to a vote.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry


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


RE: Conditional Form Elements

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
I think someone created contrib:FormConditional.

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


> -----Original Message-----
> From: Joel Trunick [mailto:joel.trunick@webifysolutions.com] 
> Sent: Thursday, June 10, 2004 3:34 PM
> To: Tapestry users
> Subject: Conditional Form Elements
> 
> 
> 
> Did this go anywhere?...
> 
> Joel
> 
> From: Howard M. Lewis Ship <hl...@attbi.com>
> Subject: Conditional Form elements/Stale Link page
> Date: Wed, 25 Jun 2003 20:02:56 -0400
> Content-Type: text/plain;
> 	charset="us-ascii"
> 
> I was thinking about this on the drive home.
> 
> First off: shadow variables.  If you want to have:
> 
> <input jwcid="@Checkbox" selected="ognl:a">
> <span jwcid="@Conditional" condition="ognl:a">
> ...
> </span>
> 
> That's a problem.  When the form rewinds, if the user has clicked the
> checkbox, then the content of
> the conditional either renders or doesn't ... but doesn't
> match the original render.  Fall down, go boom.
> 
> Now let's imagine that before we render we set property b to match
> property a:
> 
> <input jwcid="@Checkbox" selected="ognl:a">
> <span jwcid="@Conditional" condition="ognl:b">
> ...
> </span>
> 
> b shadows a.  As long as we set b properly before we rewind, then the
> rewind will match the original
> render, even if the user changes property a.
> In the form listener, we update b from a once it is safe.
> 
> Thought #1:
> 
> How about a FormConditional component?  Similar to the relationship
> between Foreach and ListEdit.
> On render, the FC reads a, stores it into a hidden field, and 
> renders or
> doesn't appropriately.
> On rewind, the FC ignores a, reads the stored value, and renders or
> doesn't appropriately (matching
> the render no matter what).
> 
> Thought #2:
> 
> Change the Conditional component to do exactly that: if inside a Form
> then do what I just described
> for FC.
> 
> Thought #3:
> 
> That's a bigger change than I'm comfortable for in a beta.  I'd still
> like to do it, but from a
> community sense, I want to put it to a vote.
> 
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> 
> 
> ---------------------------------------------------------------------
> 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