On Fri, Aug 8, 2008 at 10:59 AM, Rick Mangi <[EMAIL PROTECTED]> wrote:
>
> The idea would be something like this:
>
> <definition name="js-tile" template="/WEB-INF/tiles/fragments/jstile.jsp">
>
>    <put-list-attribute name="js_files">
>
>     <add-attribute value="/js/prototype.js"/>
>
>     <add-attribute value="/js/common.js" />
>
>     <add-attribute value="/js/messages.js" />
>
>     <add-attribute value="/js/mousePos.js"/>
>    </put-list-attribute>
> </definition>
>
>
> <definition name="my-other-tile">
>    <put-list-attribute name="js_files">
>        <add-attribute value="/js/myotherjs.js"/>
>    </put-list-attribute>
> </definition>
>
>
> I could see how this could be expanded to maybe use an
> <append-list-attribute> tag instead to be more explicit.
>
> Is there a way to do this in code if not in the tiles.xml?

Just a sanity check: have you tried it? I'm not sure if extended
<put-list-attribute> tags are "additive" or not - meaning I'm not sure
if things added in extended <put-list-attribute> tags are added to the
original list or if the extended list replaces the original. If it
doesn't work one thing you could try is creating a placeholder list in
the master tile and putting attributes in it in the child tile. For
example:

<definition name="js-tile" template="/WEB-INF/tiles/fragments/jstile.jsp">
   <put-list-attribute name="js_files">
      <add-attribute value="/js/prototype.js"/>
      <add-attribute value="/js/common.js" />
      <add-attribute value="/js/messages.js" />
      <add-attribute value="/js/mousePos.js"/>
   </put-list-attribute>
   <put-list-attribute name="js_extended"/>
</definition>

<definition name="my-other-tile">
   <put-list-attribute name="js_extended">
       <add-attribute value="/js/myotherjs.js"/>
   </put-list-attribute>
</definition>

Then in your template you would need to reference both the "js_files"
and "js_extended" attributes.

Greg

Reply via email to