You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Henry Park <He...@isd.lacounty.gov> on 2007/12/26 19:41:16 UTC

appending tags

How can I append the values in a list to a struts tag? For example, in
the example below, how can I append 'lastname' into 'AppendedList'?

<s:set name="AppendedList" value=""/>

<s:iterator value="resultList" status="status">
  <s:property name="lastname"/>
</s:iterator>

I have tried 

<s:append id="AppendedList">
  <s:param value="lastname"/>
</s:append>

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


RE: appending tags

Posted by Al Sutton <al...@alsutton.com>.
Do it in your action code. A JSP is not the place for manipulating objects
such as Lists (repeat this 100 times).

-----Original Message-----
From: news [mailto:news@ger.gmane.org] On Behalf Of Laurie Harper
Sent: 27 December 2007 23:56
To: user@struts.apache.org
Subject: Re: appending tags

Henry Park wrote:
> How can I append the values in a list to a struts tag? For example, in 
> the example below, how can I append 'lastname' into 'AppendedList'?
> 
> <s:set name="AppendedList" value=""/>
> 
> <s:iterator value="resultList" status="status">
>   <s:property name="lastname"/>
> </s:iterator>
> 
> I have tried
> 
> <s:append id="AppendedList">
>   <s:param value="lastname"/>
> </s:append>

I'm not sure what you're trying to accomplish, but that doesn't look like
the purpose of s:append, which takes one or more existing lists and
concatenates them.

What can't you use resultList directly? If you describe what you're trying
to accomplish and why you want to push data into a scripting variable,
someone may be able to describe an easier approach.

L.


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


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


Re: appending tags

Posted by Laurie Harper <la...@holoweb.net>.
Henry Park wrote:
> How can I append the values in a list to a struts tag? For example, in
> the example below, how can I append 'lastname' into 'AppendedList'?
> 
> <s:set name="AppendedList" value=""/>
> 
> <s:iterator value="resultList" status="status">
>   <s:property name="lastname"/>
> </s:iterator>
> 
> I have tried 
> 
> <s:append id="AppendedList">
>   <s:param value="lastname"/>
> </s:append>

I'm not sure what you're trying to accomplish, but that doesn't look 
like the purpose of s:append, which takes one or more existing lists and 
concatenates them.

What can't you use resultList directly? If you describe what you're 
trying to accomplish and why you want to push data into a scripting 
variable, someone may be able to describe an easier approach.

L.


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