Antonio:
I just tried defining productContent in my layout.jsp
page:
<tiles:insertAttribute name="content">
<tiles:putAttribute name="productContent" value="product.grid" />
</tiles:insertAttribute>
And the page renders completely correctly. I definitely
think this is a scoping issue.
Is there a way to tell the putAttribute call above to
pull the value from the attributes of the layout
instead of hard-coding it like I just did?
I tried this to no avail:
<tiles:insertAttribute name="content">
<tiles:putAttribute name="productContent" value="%{productContent}" />
</tiles:insertAttribute>
The reason I want to do that is to re-use the
same layout for different nested content.
Here is an example:
<definition name="page.products" extends="layout">
<put-attribute name="content" value="product.nav" />
<put-attribute name="productContent" value="product.grid" />
</definition>
<definition name="page.productDetail" extends="layout">
<put-attribute name="content" value="product.nav" />
<put-attribute name="productContent" value="/productDetail.jsp" />
</definition>
These two definitions share the same layout but have different
values for productContent.
How do I achieve this with tiles?
Thanks,
Neil
--
Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com
FREE! Eliminate junk email and reclaim your inbox.
Visit http://www.spammilter.com for details.
-----Original Message-----
From: Antonio Petrelli [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 31, 2007 1:58 AM
To: [email protected]
Subject: Re: Nesting tiles 3 levels deep not finding attribute
2007/7/31, Neil Aggarwal <[EMAIL PROTECTED]>:
>
> Hello:
>
> I have been doing some googling on this and I
> came across this post:
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg24016.html
>
> So, attributes do not cascade and I have to push them down
> to the nested tiles.
>
> Looking at the syntax on that page, I took a look at
> the tiles:putAttribute tag but I cannot figure out
> how to do it.
I think this is not your case: your Tiles definitions seem to be correctly
defined. In fact, the attribute "productContent" is bound to definition "
product.grid", so I think your problem is another.
First of all, what version of Tiles are you using? Are you using it together
with a web framework?
And did you receive errors at the startup of the application?
Antonio