You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "John Dondapati (JIRA)" <ji...@apache.org> on 2011/02/08 19:54:59 UTC

[jira] Created: (WW-3569) s:radio does not select the right option on reading the value

s:radio does not select the right option on reading the value
-------------------------------------------------------------

                 Key: WW-3569
                 URL: https://issues.apache.org/jira/browse/WW-3569
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - Tags
    Affects Versions: 2.2.1
         Environment: Windows, Glassfish, Maven, Struts, Spring and Tiles
            Reporter: John Dondapati
            Priority: Minor


The template.simple.radiomap.ftl has the following code to check if the name expression value contains itemKeyString but the parameters.nameValue does not exist. 

<#if parameters.name??>
 name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
</#if>
 id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
<#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
 checked="checked" <#rt/>
</#if>

Replace this part of the file with the following and it seems to work fine as we now assign a variable with name "nameValue" with value from the el in parameters.name. Then check against itemKeyStr using this value to select that option for the radio group.

<#if parameters.name??>
<#--/*add this line*/-->
        <#assign nameValue = stack.findString(parameters.name)/> 
 name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
</#if>
 id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
<#--/*remove this line*/-->
<#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
<#--/*add this line*/-->
<#if tag.contains(nameValue, itemKeyStr) == true> 
 checked="checked" <#rt/>
</#if>


-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WW-3569) s:radio does not select the right option on reading the value

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

Lukasz Lenart updated WW-3569:
------------------------------

    Fix Version/s: 2.3.x
    
> s:radio does not select the right option on reading the value
> -------------------------------------------------------------
>
>                 Key: WW-3569
>                 URL: https://issues.apache.org/jira/browse/WW-3569
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.2.1
>         Environment: Windows, Glassfish, Maven, Struts, Spring and Tiles
>            Reporter: John Dondapati
>            Priority: Minor
>              Labels: nameValue, s:radio
>             Fix For: 2.3.x
>
>
> The template.simple.radiomap.ftl has the following code to check if the name expression value contains itemKeyString but the parameters.nameValue does not exist. 
> <#if parameters.name??>
>  name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
> </#if>
>  id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
> <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
>  checked="checked" <#rt/>
> </#if>
> Replace this part of the file with the following and it seems to work fine as we now assign a variable with name "nameValue" with value from the el in parameters.name. Then check against itemKeyStr using this value to select that option for the radio group.
> <#if parameters.name??>
> <#--/*add this line*/-->
>         <#assign nameValue = stack.findString(parameters.name)/> 
>  name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
> </#if>
>  id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
> <#--/*remove this line*/-->
> <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
> <#--/*add this line*/-->
> <#if tag.contains(nameValue, itemKeyStr) == true> 
>  checked="checked" <#rt/>
> </#if>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WW-3569) s:radio does not select the right option on reading the value

Posted by "John Dondapati (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992130#comment-12992130 ] 

John Dondapati commented on WW-3569:
------------------------------------

Can someone please put this patch in the next release? Thanks! 

> s:radio does not select the right option on reading the value
> -------------------------------------------------------------
>
>                 Key: WW-3569
>                 URL: https://issues.apache.org/jira/browse/WW-3569
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.2.1
>         Environment: Windows, Glassfish, Maven, Struts, Spring and Tiles
>            Reporter: John Dondapati
>            Priority: Minor
>              Labels: nameValue, s:radio
>
> The template.simple.radiomap.ftl has the following code to check if the name expression value contains itemKeyString but the parameters.nameValue does not exist. 
> <#if parameters.name??>
>  name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
> </#if>
>  id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
> <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
>  checked="checked" <#rt/>
> </#if>
> Replace this part of the file with the following and it seems to work fine as we now assign a variable with name "nameValue" with value from the el in parameters.name. Then check against itemKeyStr using this value to select that option for the radio group.
> <#if parameters.name??>
> <#--/*add this line*/-->
>         <#assign nameValue = stack.findString(parameters.name)/> 
>  name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
> </#if>
>  id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
> <#--/*remove this line*/-->
> <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
> <#--/*add this line*/-->
> <#if tag.contains(nameValue, itemKeyStr) == true> 
>  checked="checked" <#rt/>
> </#if>

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WW-3569) s:radio does not select the right option on reading the value

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

Lukasz Lenart updated WW-3569:
------------------------------

    Fix Version/s:     (was: 2.3.x)
                   2.3.6
    
> s:radio does not select the right option on reading the value
> -------------------------------------------------------------
>
>                 Key: WW-3569
>                 URL: https://issues.apache.org/jira/browse/WW-3569
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.2.1
>         Environment: Windows, Glassfish, Maven, Struts, Spring and Tiles
>            Reporter: John Dondapati
>            Priority: Minor
>              Labels: nameValue, s:radio
>             Fix For: 2.3.6
>
>
> The template.simple.radiomap.ftl has the following code to check if the name expression value contains itemKeyString but the parameters.nameValue does not exist. 
> <#if parameters.name??>
>  name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
> </#if>
>  id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
> <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
>  checked="checked" <#rt/>
> </#if>
> Replace this part of the file with the following and it seems to work fine as we now assign a variable with name "nameValue" with value from the el in parameters.name. Then check against itemKeyStr using this value to select that option for the radio group.
> <#if parameters.name??>
> <#--/*add this line*/-->
>         <#assign nameValue = stack.findString(parameters.name)/> 
>  name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
> </#if>
>  id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
> <#--/*remove this line*/-->
> <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
> <#--/*add this line*/-->
> <#if tag.contains(nameValue, itemKeyStr) == true> 
>  checked="checked" <#rt/>
> </#if>

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

[jira] [Commented] (WW-3569) s:radio does not select the right option on reading the value

Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474111#comment-13474111 ] 

Lukasz Lenart commented on WW-3569:
-----------------------------------

As I understand, there is no problem right now ?
                
> s:radio does not select the right option on reading the value
> -------------------------------------------------------------
>
>                 Key: WW-3569
>                 URL: https://issues.apache.org/jira/browse/WW-3569
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.2.1
>         Environment: Windows, Glassfish, Maven, Struts, Spring and Tiles
>            Reporter: John Dondapati
>            Priority: Minor
>              Labels: nameValue, s:radio
>             Fix For: 2.3.6
>
>
> The template.simple.radiomap.ftl has the following code to check if the name expression value contains itemKeyString but the parameters.nameValue does not exist. 
> <#if parameters.name??>
>  name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
> </#if>
>  id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
> <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
>  checked="checked" <#rt/>
> </#if>
> Replace this part of the file with the following and it seems to work fine as we now assign a variable with name "nameValue" with value from the el in parameters.name. Then check against itemKeyStr using this value to select that option for the radio group.
> <#if parameters.name??>
> <#--/*add this line*/-->
>         <#assign nameValue = stack.findString(parameters.name)/> 
>  name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
> </#if>
>  id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
> <#--/*remove this line*/-->
> <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
> <#--/*add this line*/-->
> <#if tag.contains(nameValue, itemKeyStr) == true> 
>  checked="checked" <#rt/>
> </#if>

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

[jira] [Commented] (WW-3569) s:radio does not select the right option on reading the value

Posted by "Johannes Geppert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055416#comment-13055416 ] 

Johannes Geppert commented on WW-3569:
--------------------------------------

The nameValue was already assigned in the UIBean Component.

        if (parameters.containsKey("value")) {
            parameters.put("nameValue", parameters.get("value"));
        } else {
            if (evaluateNameValue()) {
                final Class valueClazz = getValueClassType();

                if (valueClazz != null) {
                    if (value != null) {
                        addParameter("nameValue", findValue(value, valueClazz));
                    } else if (name != null) {
                        String expr = completeExpressionIfAltSyntax(name);

                        addParameter("nameValue", findValue(expr, valueClazz));
                    }
                } else {
                    if (value != null) {
                        addParameter("nameValue", findValue(value));
                    } else if (name != null) {
                        addParameter("nameValue", findValue(name));
                    }
                }
            }
        }



> s:radio does not select the right option on reading the value
> -------------------------------------------------------------
>
>                 Key: WW-3569
>                 URL: https://issues.apache.org/jira/browse/WW-3569
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.2.1
>         Environment: Windows, Glassfish, Maven, Struts, Spring and Tiles
>            Reporter: John Dondapati
>            Priority: Minor
>              Labels: nameValue, s:radio
>
> The template.simple.radiomap.ftl has the following code to check if the name expression value contains itemKeyString but the parameters.nameValue does not exist. 
> <#if parameters.name??>
>  name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
> </#if>
>  id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
> <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
>  checked="checked" <#rt/>
> </#if>
> Replace this part of the file with the following and it seems to work fine as we now assign a variable with name "nameValue" with value from the el in parameters.name. Then check against itemKeyStr using this value to select that option for the radio group.
> <#if parameters.name??>
> <#--/*add this line*/-->
>         <#assign nameValue = stack.findString(parameters.name)/> 
>  name="${parameters.name?html}" nmv="${nameValue?html} <#rt/>
> </#if>
>  id="${parameters.id?html}${itemKeyStr?html}" <#rt/>
> <#--/*remove this line*/-->
> <#if tag.contains(parameters.nameValue?default(''), itemKeyStr)> 
> <#--/*add this line*/-->
> <#if tag.contains(nameValue, itemKeyStr) == true> 
>  checked="checked" <#rt/>
> </#if>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira