You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Mindbridge <mi...@yahoo.com> on 2003/10/04 11:16:51 UTC

template tag

Another quick thing: in a previous beta we added the ability for components to get access to the tag with which they were inserted in their parent's template. This allowed, for example, the 'element' parameter of the Any component to become optional, and you could do, for example:
<td jwcid="@Any" width="..">

In the current implementation all components are automatically given a "templateTag" parameter and that parameter is bound. The problem is that very few of all parameters actually care about that, so in effect, this constitutes a massive overkill. I would like to suggest to change this behaviour to 'if the component has a templateTag parameter and it is not bound, bind it to the tag with which it was inserted in the parent's template'. This behaviour is much more economical, still does the job, and it works -- I have it running on my machine. Anything against making this change?

Also, it is trivial to bind the default values of the 'element' parameters of the existing components to 'templateTag'. But should we actually name the template tag parameter 'element' (instead of 'templateTag')? This will be backward compatible for the standard components and will make them support the above behaviour described for Any in a single stroke, but it may not be terribly backward compatible when it comes to other components. Nevertheless, does it make sense?

-mb


RE: template tag

Posted by David Solis <ds...@legosoft.com.mx>.

> -----Original Message-----
> From: Mindbridge [mailto:mindbridgeweb@yahoo.com]
> Sent: Saturday, October 04, 2003 3:17 AM
> To: Tapestry development
> Subject: template tag
> 
> Another quick thing: in a previous beta we added the ability for
> components to get access to the tag with which they were inserted in
their
> parent's template. This allowed, for example, the 'element' parameter
of
> the Any component to become optional, and you could do, for example:
> <td jwcid="@Any" width="..">
> 
> In the current implementation all components are automatically given a
> "templateTag" parameter and that parameter is bound. The problem is
that
> very few of all parameters actually care about that, so in effect,
this
> constitutes a massive overkill. I would like to suggest to change this
> behaviour to 'if the component has a templateTag parameter and it is
not
> bound, bind it to the tag with which it was inserted in the parent's
> template'. This behaviour is much more economical, still does the job,
and
> it works -- I have it running on my machine. Anything against making
this
> change?
> 
It sounds good to me.

> Also, it is trivial to bind the default values of the 'element'
parameters
> of the existing components to 'templateTag'. But should we actually
name
> the template tag parameter 'element' (instead of 'templateTag')? This
will
> be backward compatible for the standard components and will make them
> support the above behaviour described for Any in a single stroke, but
it
> may not be terribly backward compatible when it comes to other
components.
> Nevertheless, does it make sense?
> 
I'm afraid this rule doesn't apply for kind of conditional components.
In some cases they are just simple containers.

> -mb



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