struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Huber (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (WW-4181) s:radio not selecting initial value correctly
Date Wed, 21 Aug 2013 11:10:52 GMT

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

Greg Huber edited comment on WW-4181 at 8/21/13 11:10 AM:
----------------------------------------------------------

Hello,

On further testing we seem to have to modify the isChecked(..) method used in checkboxlist
to:

<code>
private Boolean isChecked(Map<String, Object> params, String itemKeyStr) {
        Boolean checked = false;
        if (itemKeyStr != null) {

            // NameValue are the values that is provided by the name property
            // in the action
            Object nameValue = params.get("nameValue");

            Iterator itt = MakeIterator.convert(nameValue);
            while (itt.hasNext()) {

                String value = (String) itt.next();
                if (checked = value.equalsIgnoreCase(itemKeyStr)) {
                    break;
                }

            }

        }
        return checked;
    }
<code>

Which will handle both arrays and single strings in the name property.  Maybe this also needs
to done on the checkboxlist? as if you do not use a String[] in name we get a class cast exception.

Cheers Greg.
                
      was (Author: gregh99):
    Hello,

On further testing we seem to have to modify the isChecked(..) method used in checkboxlist
to:

<code>
private Boolean isChecked(Map<String, Object> params, String itemKeyStr) {
        Boolean checked = false;
        if (itemKeyStr != null) {

            // NameValue are the values that is provided by the name property
            // in the action
            Object nameValue = params.get("nameValue");

            Iterator itt = MakeIterator.convert(nameValue);
            while (itt.hasNext()) {

                String value = (String) itt.next();
                if (checked = value.equalsIgnoreCase(itemKeyStr)) {
                    break;
                }

            }

        }
        return checked;
    }
<code>

Which will handle both arrays and single strings in the name property.  Maybe this also needs
to done on the checkboxlist? as if you do not use a String[] in name we get a class cast exception.

Cheers Greg.



Cheers Greg.
                  
> s:radio not selecting initial value correctly
> ---------------------------------------------
>
>                 Key: WW-4181
>                 URL: https://issues.apache.org/jira/browse/WW-4181
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Java Templates
>    Affects Versions: 2.3.15.1
>         Environment: Tomcat/centos
>            Reporter: Greg Huber
>            Priority: Minor
>         Attachments: radiohandler.patch
>
>
> Hello,
> The s:radio is not selecting its initial value correctly.  We need the same mods as in
checkboxlist ie
> private Boolean isChecked(Map<String, Object> params, String itemKeyStr) 
> method.
> Cheers Greg

--
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

Mime
View raw message