You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Roland McIntosh (JIRA)" <ji...@apache.org> on 2012/05/16 22:03:07 UTC

[jira] [Commented] (WW-3173) list={ 'foo': 'bar' } unusable with struts-tags such as <@s.radio /> on freemarker results.

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

Roland McIntosh commented on WW-3173:
-------------------------------------

You can do this too:
<#assign carCompanies = { "ford" : "Ford Motor Co", "toyota" : "Toyota", "chevrolet" : "Chevy" } />
<@s.radio name="car" list=carCompanies listKey="key" listValue="%{ getText( value ) }" />

Note that the map MUST be assigned to a variable -- it doesn't work inline with the radio tag.  This behavior is frustrating.  The following pages could benefit greatly from explanation and documentation of this tag's behavior with respect to list/hash literals:

http://struts.apache.org/2.3.3/docs/freemarker-tags.html
http://struts.apache.org/2.3.3/docs/radio.html

I posted to struts-user on 13 Oct 2011 about this.
                
> list={ 'foo': 'bar' } unusable with struts-tags such as <@s.radio /> on freemarker results.
> -------------------------------------------------------------------------------------------
>
>                 Key: WW-3173
>                 URL: https://issues.apache.org/jira/browse/WW-3173
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.8
>            Reporter: Antti Lankila
>            Assignee: Lukasz Lenart
>            Priority: Minor
>             Fix For: 2.3.3
>
>
> Trying to render something like this:
> <@s.radio name="x" list={'foo': 'bar'} />
> results in stringifications of freemarker.ext.beans.HashAdapter instead of the desired keys and values. Support for converting this to something that the radiomap.ftl could handle properly would be great.
> Manual workaround available with hiding the forcibly generated label and appending another manually:
> <style type="text/css"> .brokenMapBehaviourWorkaround label { display: none; } </style>
> <div class="brokenMapBehaviourWorkaround"><@s.radio name="x" list=['foo'] /> bar</div>

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