Not 100% sure on this, but...
As near as I can tell from the "For" component (from t-deli),
it looks like you could define a "templateTag" parameter
which will be automatically set by the framework.
Take a look at "For.jwc" for more details, but, something like:
<parameter name="templateTag" type="java.lang.String" direction="auto"
default-value="null"/>

Robert

NAEEM MALIK wrote:
> Something that I find would be very useful for
> Tapestry developers is a method for components to
> output the element they are defined in. This is useful
> because components always throw away the element they
> are defined in and this element is often an important
> part of the HTML page.
> 
> For example if my HTML page contains a component
> called "menu" as below:
> 
> <div class="menu" style="height: 100px; width: 50px;"
> jwcid="menu">
> 
> </div>
> 
> After rendering, I would want the output to be:
> 
> <div class="menu" style="height: 100px; width: 50px;">
> link1
> link2
> etc...
> </div>
> 
> What I will normally get is just a collection of links
> without the outer DIV tag.
> 
> The only way I can currently achieve the required
> output is if the menu component contained an 'element'
> parameter which specified the name of the element to
> output (in this case 'div') and by using the render
> code below.
> 
> writer.begin(element);
> renderInformalParameters(writer, cycle);
> writer.renderBody(writer, cycle);
> writer.end(element);
> 
> This 'element parameter' solution is not very elegant
> but it seems it is the only way to solve this problem
> because instances of components know nothing about the
> element they are defined in.
> 
> In summary, it would be useful for a component to know
> about the element it was defined in (just as it knows
> about its informal parameters). Even better would be a
> 'renderElement' option which tells Tapestry to render
> the component within the body of the element it was
> defined in rather than replacing the element it was
> defined in.
> 
> Has anyone else had a similar requirement or feel this
> enhancement is useful?
> 
> Thanks
> Naeem Malik
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to