--- Ezequiel Puig <[EMAIL PROTECTED]> wrote:
> in my jsp, i have an array of ids and i will like to remove one of that
> ids using s2 tags:
>
> I have tried the following, but it doesn't work :(
> <s:set name="allIDs" value="#parameters.productCode"/>
> <s:set name="newID" value=""/>
> <s:iterator value="#allIDs" status="stat">
> <s:set name="myID" value="top"/>
> <s:if test='%{ idToRemove != #myID }'>
> <s:set name="newID[#stat]" value="#myID"/>
> </s:if>
> </s:iterator>
>
> Does anyone know how to do it ?
Depending on the underlying collection type you might get an exception.
You're not removing anything in the above code anyway, you're replacing a
value. You're also using the "status" value like it's an index, but it's not
[1].
But why? You'd have to work hard to convince me that the JSP is the place to
do something like that.
Dave
[1]
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts2/views/jsp/IteratorStatus.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]