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:04:32 GMT
Antonio:

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.


This looks like what is happening to me.

My page.products definition extends the layout
definition and puts attributes named content
and pageContent.

The layout definition uses layout.jsp which has
a call to insert the content attribute:

<%@taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<html>
  <body bgColor="#ffffff">
    <table border="0" cellspacing="0" cellpadding="0">
      <tr>
	  <td><tiles:insertAttribute name="content"/></td>
	</tr>  		
    </table>
  </body>
</html>

I set the content to product.nav which is a nested
tiles definition.  Its layout is productNavLayout.jsp
which tries to access the attribute productContent:

<%@taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left" valign="top">
      <tiles:insertAttribute name="productContent"/>			
    </td>
  </tr>
</table>			

The productContent attribute seems to be in the scope
for layout.jsp and not in the scope for 
productNavLayout.jsp which is why it can't find it.

Is there a way to tell productNavLayout.jsp to
pull it from layout.jsp's attributes?

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