You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Laszlo Borsos (JIRA)" <ji...@apache.org> on 2007/08/20 12:51:35 UTC

[jira] Created: (WW-2122) select tag listKey/listValue defaults apply to Maps only

select tag listKey/listValue defaults apply to Maps only
--------------------------------------------------------

                 Key: WW-2122
                 URL: https://issues.apache.org/struts/browse/WW-2122
             Project: Struts 2
          Issue Type: Improvement
          Components: Views
    Affects Versions: 2.0.9
         Environment: Tomcat 6, jre 6
            Reporter: Laszlo Borsos
            Priority: Minor


Webwork book states for select tag attributes:

listKey - String - Expression for the list key; key by default.
listValue - String - Expression for the list value; value by default.

I had a list of type ArrayList<KeyValueBean> and to my surprise it did not work with the defaults. I had to write.

<s:select name="id" list="nonmember" listKey="key" listValue="value" />

I think it need not be restricted to Maps.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2122) select tag listKey/listValue defaults apply to Maps only

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_41950 ] 

James Holmes commented on WW-2122:
----------------------------------

Here is information on how to provide patches to Apache software:

http://www.apache.org/dev/contributors.html#patches

Struts 2 has several JUnit tests which are intended to insure that changes to the code don't break the way that the code is expected to behave. In theory those tests will insure that the modification you are proposing doesn't break any existing functionality.

> select tag listKey/listValue defaults apply to Maps only
> --------------------------------------------------------
>
>                 Key: WW-2122
>                 URL: https://issues.apache.org/struts/browse/WW-2122
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Views
>    Affects Versions: 2.0.9
>         Environment: Tomcat 6, jre 6
>            Reporter: Laszlo Borsos
>            Priority: Minor
>             Fix For: Future
>
>
> Webwork book states for select tag attributes:
> listKey - String - Expression for the list key; key by default.
> listValue - String - Expression for the list value; value by default.
> I had a list of type ArrayList<KeyValueBean> and to my surprise it did not work with the defaults. I had to write.
> <s:select name="id" list="nonmember" listKey="key" listValue="value" />
> I think it need not be restricted to Maps.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2122) select tag listKey/listValue defaults apply to Maps only

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-2122:
-----------------------------

    Fix Version/s: Future

Seems like a good feature to me. This functionality will be more likely to be implemented if you provide a patch.

> select tag listKey/listValue defaults apply to Maps only
> --------------------------------------------------------
>
>                 Key: WW-2122
>                 URL: https://issues.apache.org/struts/browse/WW-2122
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Views
>    Affects Versions: 2.0.9
>         Environment: Tomcat 6, jre 6
>            Reporter: Laszlo Borsos
>            Priority: Minor
>             Fix For: Future
>
>
> Webwork book states for select tag attributes:
> listKey - String - Expression for the list key; key by default.
> listValue - String - Expression for the list value; value by default.
> I had a list of type ArrayList<KeyValueBean> and to my surprise it did not work with the defaults. I had to write.
> <s:select name="id" list="nonmember" listKey="key" listValue="value" />
> I think it need not be restricted to Maps.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2122) select tag listKey/listValue defaults apply to Maps only

Posted by "Laszlo Borsos (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_41949 ] 

Laszlo Borsos commented on WW-2122:
-----------------------------------

The restriction is done in org.apache.struts2.components.ListUIBean, which is an abstract base class of 5 bundled components. So serious consideration is needed not to break existing code. Otherwise the modification would be this:

In 2.0.9: Line 106 and 119: "if (value instanceof Map)" to be omitted.

PS. Did not find how to provide patches.


> select tag listKey/listValue defaults apply to Maps only
> --------------------------------------------------------
>
>                 Key: WW-2122
>                 URL: https://issues.apache.org/struts/browse/WW-2122
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Views
>    Affects Versions: 2.0.9
>         Environment: Tomcat 6, jre 6
>            Reporter: Laszlo Borsos
>            Priority: Minor
>             Fix For: Future
>
>
> Webwork book states for select tag attributes:
> listKey - String - Expression for the list key; key by default.
> listValue - String - Expression for the list value; value by default.
> I had a list of type ArrayList<KeyValueBean> and to my surprise it did not work with the defaults. I had to write.
> <s:select name="id" list="nonmember" listKey="key" listValue="value" />
> I think it need not be restricted to Maps.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.