tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Petrelli" <antonio.petre...@gmail.com>
Subject Re: Nesting tiles 3 levels deep not finding attribute
Date Tue, 31 Jul 2007 16:41:50 GMT
2007/7/31, Neil Aggarwal <neil@jammconsulting.com>:
> According to the Tiles FAQ:
>
> I filled an attribute of a template, but it did not get
> in an inner template. What happened?
>
> Attributes must be filled in the correct template. In other words,
> there are no "pass-through" attributes, that you fill in the
> master template and get filled in the inner ones.
> ...
> Is there a way to tell productNavLayout.jsp to
> pull it from layout.jsp's attributes?

The solution is in the second sentence of the FAQ:

<snip>
In this case, usually you have to create a new definition extending
from an existing one, fill the attribute in the correct template and
assign the new definition as an attribute to the main template.
</snip>

In other words:

 <definition name="product.nav" template="/productNavLayout.jsp">
   <put-attribute name="productPathNav" value="/productPathNav.jsp" />
   <put-attribute name="productNav" value="/productNav.jsp" />
 </definition>

 <definition name="product.nav.extended" extends="product.nav">
   <put-attribute name="productContent" value="product.grid" />
 </definition>

 <definition name="page.products" extends="layout">
   <put-attribute name="content" value="product.nav.extended" />
 </definition>

HTH
Antonio
> 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: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?
>
> Antonio
>
>

Mime
View raw message