You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Derek Richardson <De...@appiancorp.com> on 2003/11/26 20:45:18 UTC

[tiles] putList - adding, not replacing, elements

Two definitions, A and B. B extends A. I want to be able to add elements to a list attribute, adding some in A and some in B. Real code:

  <definition name="portal.portlet" page="/template/portal_portlet.jsp" controllerUrl="/portlet.do">
    <put name="$s" value="maximized"/>
    <putList name="javascriptUrls">
      <add value="/ajs2.jsp" />
    </putList>
  </definition>

  <definition name="portal.portlet.dt" extends="portal.portlet">
    <put name="$t" value="/p_dt/view.do"/>
    <put name="customizer" value="/p_dt/config.do"/>
    <putList name="javascriptUrls">
      <add value="/ajs1.jsp" />
    </putList>
  </definition>

When I insert "portal.portlet.dt", I want to see an attribute "javascriptUrls" with two values: "/ajs1.jsp" and "/ajs2.jsp". Currently, I see only "/ajs1.jsp". It seems that the putList in the child definition hides the parent list instead of adding to it.

Is there a way to do this?

Thanks,

Derek Richardson

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: [tiles] putList - adding, not replacing, elements

Posted by Jeff Kyser <kt...@comcast.net>.
doesn't appear to be a way from the docs I've seen -

	tile definitions can be extended, and all properties and attributes 
are inherited.

	properties and attributes can be overloaded, which would result in the
	replacement behavior you are seeing.


The (pdf) document I was looking at was accessible via the 'Tiles 
Advanced Features'
link on the following page:

	http://jakarta.apache.org/struts/userGuide/dev_tiles.html

Its a nice document with a lot of good examples, and I didn't see 
anything like
what you wanted in there.

-jeff

On Wednesday, November 26, 2003, at 01:45  PM, Derek Richardson wrote:

> Two definitions, A and B. B extends A. I want to be able to add 
> elements to a list attribute, adding some in A and some in B. Real 
> code:
>
>   <definition name="portal.portlet" 
> page="/template/portal_portlet.jsp" controllerUrl="/portlet.do">
>     <put name="$s" value="maximized"/>
>     <putList name="javascriptUrls">
>       <add value="/ajs2.jsp" />
>     </putList>
>   </definition>
>
>   <definition name="portal.portlet.dt" extends="portal.portlet">
>     <put name="$t" value="/p_dt/view.do"/>
>     <put name="customizer" value="/p_dt/config.do"/>
>     <putList name="javascriptUrls">
>       <add value="/ajs1.jsp" />
>     </putList>
>   </definition>
>
> When I insert "portal.portlet.dt", I want to see an attribute 
> "javascriptUrls" with two values: "/ajs1.jsp" and "/ajs2.jsp". 
> Currently, I see only "/ajs1.jsp". It seems that the putList in the 
> child definition hides the parent list instead of adding to it.
>
> Is there a way to do this?
>
> Thanks,
>
> Derek Richardson
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org