You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Eric Everman <ev...@precedadesign.com> on 2003/05/07 03:03:15 UTC

Duplicate Any Tags

I'm using multiple Any components to provide a <td> tag with a background 
like this:

================================
.html:
<td jwcid="article_td" background="assets/blueboxbg.gif" 
class="feature_title">Article Name</td>

.jwc:
<component id="article_td" type="Any">
   <static-binding name="element" value="td"/>
   <binding name="background" expression="assets.blueboxbg"/>
</component>
================================

Unfortunately, this doesn't work b/c article_td is used multiple times in 
the page.  I could make this an implicit component, but that would mean 
making the background attribute an OGNL expression which would not preview 
correctly in a WYSIWYG editor.

Is there a way to use a 'traditional' component repeatedly, or is there 
another method to do this?

As a footnote, it would be nice if the Any tag could take its element name 
from the name of its tag, since its *almost* always the same.

Thanks,

Eric Everman

Preceda Design LLC
www.precedadesign.com


RE: Duplicate Any Tags

Posted by Mind Bridge <mi...@yahoo.com>.
Hi,

(Transferring this to the -dev list)

Christian Sell write:
> Eric Everman wrote:
> > As a footnote, it would be nice if the Any tag could take its element
> > name from the name of its tag, since its *almost* always the same.
>
> +10

This was actually something that I had on my "stir-fry" list, but I forgot
about.

Can we have a predefined binding, say "$tag" that will be bound to the tag
in the HTML template? (This would obviously be bound only if there is a
template)

It would allow an implementation of Any that will do what people are asking
for.

What do you think?

-mb



Re: Duplicate Any Tags

Posted by Christian Sell <ch...@netcologne.de>.
Eric Everman wrote:
> I'm using multiple Any components to provide a <td> tag with a 
> background like this:
> 
> ================================
> .html:
> <td jwcid="article_td" background="assets/blueboxbg.gif" 
> class="feature_title">Article Name</td>
> 
> .jwc:
> <component id="article_td" type="Any">
>   <static-binding name="element" value="td"/>
>   <binding name="background" expression="assets.blueboxbg"/>
> </component>
> ================================
> 
> Unfortunately, this doesn't work b/c article_td is used multiple times 
> in the page.  I could make this an implicit component, but that would 
> mean making the background attribute an OGNL expression which would not 
> preview correctly in a WYSIWYG editor.
> 
> Is there a way to use a 'traditional' component repeatedly, or is there 
> another method to do this?

there it is again - reusing component configurations. Ideally, one could 
even setup the component on the application level, and reuse it in many 
pages..
If I may guess, the only solution currently is to create a full 
component (html, jwc and all) and reference that.

> 
> As a footnote, it would be nice if the Any tag could take its element 
> name from the name of its tag, since its *almost* always the same.

+10

> 
> Thanks,
> 
> Eric Everman
> 
> Preceda Design LLC
> www.precedadesign.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>