tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stanlick <stanl...@gmail.com>
Subject Re: Nested tile definitions
Date Thu, 23 Oct 2008 11:01:02 GMT

Thanks A -- 

This is actually what I had coded prior to asking my question.  The problem
with this technique is the number of permutations!  I have a rather
sophisticated layout that contains a header, main and footer.  Header
contains four portions top, middle, bottom, crumbs and main has several
sections.  In order to mix/match (override) page definitions, I would need
far too many tile-defs!  If I could override, say, home.header.bottom from a
sub definition this would be the cleanest.  I would be interested in helping
out with the Tiles coding if you think this is a possibility.

Peace,
Scott 



Antonio Petrelli-3 wrote:
> 
> 2008/10/22 stanlick <stanlick@gmail.com>:
>>  <definition name="myapp.header" template="/tiles/header.jsp">
>> ...
>>    <put-attribute name="breadcrumbs"
>> value="/tiles/header-breadcrumbs.jsp"
>> />
>>  </definition>
>>...
>>
>>  <definition name="myapp.homePage"
>> template="/layouts/page-container.jsp">
>>    <put-attribute name="header" value="myapp.header" />
>>  </definition>
>>...
>>  <definition name="myapp.homePageNoCrumbs" extends="myapp.homePage">
>>    <put-attribute name="title" value="Prototype Struts 2 Web Application
>> with NO CRUMBS" />
>>    <put-attribute name="myapp.header.breadcrumbs"
>> value="/tiles/blank.jsp"
>> />
>>  </definition>
>>
>> Is it possible to override nested attributes in a sub-definition?
> 
> In Tiles 2.0 never, in Tiles 2.1 there is a possibility.
> *Don't* define the "breadcrumbs" attribute in "myapp.header" and
> define a cascaded attribute in myapp.homePage and
> myapp.homePageNoCrumbs:
> 
> <definition name="myapp.homePage" template="/layouts/page-container.jsp">
> ...
>   <put-attribute name="header" value="myapp.header" />
>   <put-attribute name="breadcrumbs" value="/tiles/header-breadcrumbs.jsp"
> />
> </definition>
> <definition name="myapp.homePageNoCrumbs" extends="myapp.homePage">
> ...
>    <put-attribute name="breadcrumbs" value="/tiles/blank.jsp" />
> </definition>
> 
> If you still are using Tiles 2.0, then you have to create a definition
> that extends myapp.header.breadcrumbs and put it as the "header"
> attribute in myapp.homePageNoCrumbs.
> 
> HTH
> Antonio
> 
> 

-- 
View this message in context: http://www.nabble.com/Nested-tile-definitions-tp20116049p20128710.html
Sent from the tiles users mailing list archive at Nabble.com.


Mime
View raw message