You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2013/01/21 23:08:15 UTC

[jira] [Resolved] (WW-3912) CheckboxList does not render correctly

     [ https://issues.apache.org/jira/browse/WW-3912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart resolved WW-3912.
-------------------------------

    Resolution: Fixed
      Assignee: Lukasz Lenart

Patch applied, thanks for reporting!
                
> CheckboxList does not render correctly
> --------------------------------------
>
>                 Key: WW-3912
>                 URL: https://issues.apache.org/jira/browse/WW-3912
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Java Templates
>    Affects Versions: 2.3.4.1
>         Environment: Centos/tomcat
>            Reporter: Greg Huber
>            Assignee: Lukasz Lenart
>            Priority: Minor
>             Fix For: 2.3.9
>
>
> Hello,
> The CheckboxList does not handle correctly the params.get("nameValue");, as for the list they are an array of strings.
> The following code makes it work correctly, CheckboxListHandler.java
> {code:java}
> Boolean checked = false;
> if (itemKeyStr != null) {
>  String[] parms = (String[]) params.get("nameValue");
>  for (String parm : parms) {
>   if (checked = parm.equalsIgnoreCase(itemKeyStr))
>    break;
>  }
> }
>                 
> //Checkbox button section
> Attributes a = new Attributes();
>  a.add("type", "checkbox")
>  .add("name", name)
>  .add("value", itemKeyStr)
>  .addIfTrue("checked", checked)  <<< CHANGED
>  .addIfTrue("readonly", params.get("readonly"))
>  .addIfTrue("disabled", disabled)
>  .addIfExists("tabindex", params.get("tabindex"))
>  .addIfExists("id", name + "-" + Integer.toString(cnt++));
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira