You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tiles.apache.org by "Antonio Petrelli (JIRA)" <ji...@apache.org> on 2010/03/10 12:25:27 UTC
[jira] Commented: (TILES-494) Add support for a default value to
attribute's cascade
[ https://issues.apache.org/jira/browse/TILES-494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843529#action_12843529 ]
Antonio Petrelli commented on TILES-494:
----------------------------------------
Sorry for the delay, but we had a problem during the migration about the issues mailing list.
I disagree here, the "cascade" mechanism should be used rarely, only when you cannot put the attribute where it belongs, using anonymous nested definitions for example.
> Add support for a default value to attribute's cascade
> ------------------------------------------------------
>
> Key: TILES-494
> URL: https://issues.apache.org/jira/browse/TILES-494
> Project: Tiles
> Issue Type: Improvement
> Components: tiles-core
> Affects Versions: 2.2.2
> Reporter: Mck SembWever
>
> Make it possible to specify a default value for attribute@cascade.
> I'm writing definitions for a legacy project and we don't have the luxury of a flat template that directly inserts each defined attribute.
> To have to specify cascade="true" on every put-attribute seems excessive verbosity.
> One solution would be to add a boolean attribute cascadeAttributes to Definition.
> For example:
> <definition name="myapp.homepage" template="/layouts/classic.jsp" cascade-attributes="true">
> <put-attribute name="header" value="/tiles/banner.jsp" />
> <put-attribute name="menu" value="/tiles/common_menu.jsp" />
> <put-attribute name="body" value="/tiles/home_body.jsp" />
> <put-attribute name="footer" value="/tiles/credits.jsp" />
> </definition>
> instead of today's
> <definition name="myapp.homepage" template="/layouts/classic.jsp">
> <put-attribute name="header" value="/tiles/banner.jsp" cascade="true" />
> <put-attribute name="menu" value="/tiles/common_menu.jsp" cascade="true" />
> <put-attribute name="body" value="/tiles/home_body.jsp" cascade="true" />
> <put-attribute name="footer" value="/tiles/credits.jsp" cascade="true" />
> </definition>
> Implementation:
> + add to FillDefinitionRule.begin()
> definition.setCascadeAttributes("true".equals(attributes.getValue("cascade-attributes")));
> + change in PutAttributeRule.begin()
> definition.putAttribute(attributes.getValue("name"), attribute,
> "true".equals(attributes.getValue("cascade")) || definition.getCascadeAttributes());
> + add to Definition the getter and setter methods: getCascadeAttributes and setCascadeAttributes
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.