tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Aggarwal" <n...@JAMMConsulting.com>
Subject RE: Nesting tiles 3 levels deep not finding attribute
Date Tue, 31 Jul 2007 15:21:09 GMT

I just tried defining productContent in my layout.jsp

<tiles:insertAttribute name="content">
  <tiles:putAttribute name="productContent" value="product.grid" />

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}" />

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 name="page.productDetail" extends="layout">
    <put-attribute name="content" value="product.nav" />
    <put-attribute name="productContent" value="/productDetail.jsp" />

These two definitions share the same layout but have different
values for productContent.

How do I achieve this with tiles?


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:antonio.petrelli@gmail.com] 
Sent: Tuesday, July 31, 2007 1:58 AM
To: users@tiles.apache.org
Subject: Re: Nesting tiles 3 levels deep not finding attribute

2007/7/31, Neil Aggarwal <neil@jammconsulting.com>:
> Hello:
> I have been doing some googling on this and I
> came across this post:
> http://www.mail-archive.com/struts-user@jakarta.apache.org/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?


View raw message