tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcosio <dcco...@gmail.com>
Subject Re: Tiles not building extended content
Date Mon, 06 Oct 2008 14:36:09 GMT

I think that code does work. I use the main layout for my home page and the
home page works. I plan on trying tiles 2.1 instead. Steps 2 and 3 that you
defined is similar to what I found in other parts of the forum.. Thanks for
responding so fast. I'm going to try this asap..



Antonio Petrelli-3 wrote:
> 
> 2008/10/6 dcosio <dccosio@gmail.com>:
>>
>> Using Struts 2.0.11.2, Spring 2.5.2, tiles 2.0.4.
> 
> First of all, you't better upgrade to Tiles 2.0.6.
> 
>> I searched the forum a bit and found a post that sort explained the
>> problem
>> I'm having. It seem that since my extends are going more than 3 deep is
>> the
>> problem(it wasn't a problem in tiles1).
> 
> No, it's not your problem.
> 
>>        <tiles:insertAttribute name="pageContent">
>>            <tiles:putAttribute name="pageContent"  ><tiles:getAsString
>> name="contentPane"   ignore="true"/></tiles:putAttribute>
>>...
> 
> This piece of code does not work, since the <tiles:getAsString> does
> not get an attribute from the context "outside" the
> <tiles:insertAttribute>, but from a new context created with the
> opening of the <tiles:insertAttribute> itself.
> I think that you want to "pass through" the attributes from a template
> to an inner template, right?
> 
> To fix it, you have three choices:
> 1. Use <tiles:importAttribute> to import attributes and then use it in
> <tiles:putAttribute>
> 
> For example:
> 
> <tiles:importAttribute name="pageContent">
> ...
> <tiles:insertAttribute name="pageContent">
>        <tiles:putAttribute name="pageContent"  value="${pageContent}" />
> ....
> 
> 2. Refactor your definitions (best choice with Tiles 2.0.x) to create
> an inner definition and put it instead, so add a new level of nested
> definitions.
> 
> 3. Use Tiles 2.1 "cascaded" attributes: you can define an attribute
> that cascades at all nested levels of attributes (documentation under
> development).
> 
> Let me know how it goes.
> Antonio
> 
> 

-- 
View this message in context: http://www.nabble.com/Tiles-not-building-extended-content-tp19837124p19839187.html
Sent from the tiles users mailing list archive at Nabble.com.


Mime
View raw message