You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2008/09/26 17:11:02 UTC

svn commit: r699357 - /tiles/framework/trunk/src/site/apt/tutorial/advanced/list-attributes.apt

Author: apetrelli
Date: Fri Sep 26 08:11:01 2008
New Revision: 699357

URL: http://svn.apache.org/viewvc?rev=699357&view=rev
Log:
TILES-297
Inheritance in list attributes documented.

Modified:
    tiles/framework/trunk/src/site/apt/tutorial/advanced/list-attributes.apt

Modified: tiles/framework/trunk/src/site/apt/tutorial/advanced/list-attributes.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/tutorial/advanced/list-attributes.apt?rev=699357&r1=699356&r2=699357&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/tutorial/advanced/list-attributes.apt (original)
+++ tiles/framework/trunk/src/site/apt/tutorial/advanced/list-attributes.apt Fri Sep 26 08:11:01 2008
@@ -28,6 +28,8 @@
   need a <collection> of values, for example a list of definitions to be
   redendered one below the other.
 
+* Simple usage
+
   To include a list attribute you can use the <<<\<put-list-attribute\>>>> tag
   in your Tiles definitions file:
 
@@ -57,3 +59,38 @@
   The list attribute is first converted into a scripting variable; after that
   it is iterated using the <<<\<c:forEach\>>>> tag. The compound attributes are
   then rendered one after the other.
+
+* List attribute inheritance
+
+  When you extend a definition that contains a list attribute, you can
+  "inherit" its elements. For example:
+
+---------------------------------------
+<definition name="myapp.homepage.body" template="/layouts/variable_rows.jsp">
+  <put-list-attribute name="items">
+    <add-attribute value="/tiles/banner.jsp" />
+    <add-attribute value="/tiles/common_menu.jsp" />
+    <add-attribute value="/tiles/credits.jsp" />
+  </put-list-attribute>
+</definition>
+
+<definition name="myapp.homepage.body.extended" extends="myapp.homepage.body">
+  <put-list-attribute name="items" inherit="true">
+    <add-attribute value="/tiles/greetings.jsp" />
+  </put-list-attribute>
+</definition>
+---------------------------------------
+
+  In this case, the <<<myapp.homepage.body.extended>>> has the <<<items>>>
+  attribute that inherits the content of the <<<items>>> attribute of its
+  parent definition. In other words, the <<<items>>> attribute will container
+  the following elements:
+
+  * /tiles/banner.jsp
+
+  * /tiles/common_menu.jsp
+
+  * /tiles/credits.jsp
+
+  * /tiles/greetings.jsp
+ 
\ No newline at end of file