You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ben Eng <be...@jetpen.com> on 2005/04/28 18:06:51 UTC
automatically set element parameter in Foreach and ListEdit
Components that iterate like Foreach and ListEdit take an element
parameter. Usually, a static-binding is used to set the element; and
it is almost certainly the case that the element will match the tag
in the template, where the component appears. e.g.,
<tr jwcid="@Foreach" ... element="tr">
It would be a nice simplification if the element could by default be
inferred. e.g.,
<tr jwcid="@Foreach"> <!-- element="tr" by default -->
<li jwcid="@Foreach"> <!-- element="li" by default -->
Similarly, I'd like to apply this pattern for any component that
iterates.
Ben
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: automatically set element parameter in Foreach and ListEdit
Posted by Michael Musson <mu...@gmail.com>.
Or as a compromise: If the @Foreach is used on a span then have it
work as-is. But if the @Foreach is used on a non-span then infer the
element tag as suggested above.
On 4/28/05, Erik Hatcher <er...@ehatchersolutions.com> wrote:
> It is not always the case. I rarely use the element=".." attribute on
> @Foreach.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: automatically set element parameter in Foreach and ListEdit
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 28, 2005, at 12:06 PM, Ben Eng wrote:
> Components that iterate like Foreach and ListEdit take an element
> parameter. Usually, a static-binding is used to set the element; and
> it is almost certainly the case that the element will match the tag
> in the template, where the component appears. e.g.,
It is not always the case. I rarely use the element=".." attribute on
@Foreach.
Perhaps this is a place for a custom component that wraps @Foreach and
sets the element attribute automatically for you?
Erik
> <tr jwcid="@Foreach" ... element="tr">
>
> It would be a nice simplification if the element could by default be
> inferred. e.g.,
>
> <tr jwcid="@Foreach"> <!-- element="tr" by default -->
>
> <li jwcid="@Foreach"> <!-- element="li" by default -->
>
> Similarly, I'd like to apply this pattern for any component that
> iterates.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: automatically set element parameter in Foreach and ListEdit
Posted by Mind Bridge <mi...@yahoo.com>.
The 'For' component in the Base library on www.t-deli.com does precisely
this (by default 'element' is the same as the tag).
See http://www.t-deli.com/base-doc/components/Base.For.html
'For' also combines Foreach and ListEdit and provides the corresponding
functionality depending on the context it is in.
----- Original Message -----
From: "Ben Eng" <be...@jetpen.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, April 28, 2005 7:06 PM
Subject: automatically set element parameter in Foreach and ListEdit
> Components that iterate like Foreach and ListEdit take an element
> parameter. Usually, a static-binding is used to set the element; and
> it is almost certainly the case that the element will match the tag
> in the template, where the component appears. e.g.,
>
> <tr jwcid="@Foreach" ... element="tr">
>
> It would be a nice simplification if the element could by default be
> inferred. e.g.,
>
> <tr jwcid="@Foreach"> <!-- element="tr" by default -->
>
> <li jwcid="@Foreach"> <!-- element="li" by default -->
>
> Similarly, I'd like to apply this pattern for any component that
> iterates.
>
> Ben
>
> ---------------------------------------------------------------------
> 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