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

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

    [ https://issues.apache.org/jira/browse/WW-3912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559238#comment-13559238 ] 

Hudson commented on WW-3912:
----------------------------

Integrated in Struts2-JDK6 #623 (See [https://builds.apache.org/job/Struts2-JDK6/623/])
    WW-3912 adds proper support for checked attribute (Revision 1436650)

     Result = SUCCESS
lukaszlenart : 
Files : 
* /struts/struts2/trunk/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/CheckboxListHandler.java

                
> 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