You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2006/11/17 08:46:59 UTC

[jira] Closed: (WW-177) Select tag iterator problem

     [ http://issues.apache.org/struts/browse/WW-177?page=all ]

Don Brown closed WW-177.
------------------------

    Resolution: Not A Problem

> Select tag iterator problem
> ---------------------------
>
>                 Key: WW-177
>                 URL: http://issues.apache.org/struts/browse/WW-177
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: WW 1.3
>            Reporter: John Benediktsson
>         Assigned To: Patrick Lightbody
>
> I found a bug in the select tag.  After debugging the selectmap.jsp a bit, I also have a fix.
> In my UI, I create a select tag on an array of objects and want to display their type.
> <ui:select label="'Action'" name="'actionType'" list="myobjects" listKey="'type'" listValue="'type'" />
> My objects basically look like this:
> public class MyObject {
>     public String getType();
>     public String[] getParameters();
> }
> In the select tag, it has an iterator over the list that basically looks like:
> <webwork:iterator value="parameters['list']">
>     <webwork:property value="{parameters['listKey']}"/>
> </webwork:iterator>
> This fails to display the correct result because the current object on the stack (an instance of MyObject) has a getParameters() method which is incorrectly being called.  
> The fix is to make it use the correct object which is above the current stack pointer (i.e. adding a '../'):
> <webwork:iterator value="../parameters['list']"> 
>     <webwork:property value="{../parameters['listKey']}"/>
> </webwork:iterator>
> This is a problem in the selectmap.jsp, radiomap.jsp, and anywhere else iterators are used that depend on properties above the element in the iterator.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira