struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Holmes (JIRA)" <j...@apache.org>
Subject [jira] Updated: (WW-2763) Prepopulation of checkboxlist fails when using listValue and listKey in FreeMarker tag
Date Tue, 16 Dec 2008 03:47:36 GMT

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

James Holmes updated WW-2763:
-----------------------------

    Fix Version/s: 2.1.3

> Prepopulation of checkboxlist fails when using listValue and listKey in FreeMarker tag
> --------------------------------------------------------------------------------------
>
>                 Key: WW-2763
>                 URL: https://issues.apache.org/struts/browse/WW-2763
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.11.2
>         Environment: Struts 2.0.11.2, Vista, Java 1.6.007, FreeMarker
>            Reporter: Stephan Schroeder
>            Priority: Minor
>             Fix For: 2.1.3
>
>
> This usage of the checkboxlistworks
> <@s.checkboxlist label="Attribute" name="trainingAttributes"  list="%{@domainobjects.util.TrainingAttribute@values()}"/>
> domainobjects.util.TrainingAttribute is an enum.
> trainingAttributes is an array of type TrainingAttribute with a subset of TrainingAttribute.values().
> Of course this displays the Java-Names of the enum-Instances therefore i added the two
methods for the key and the name:
> public enum TrainingAttribute
> {
>   ADVANCED,BEGINNER,CHILDREN,WEAPON;
>   
>   public String getKey()
>   {
>     return toString();
>   }
>   
>   public String getName()
>   {
>     switch( this ) {
>       case ADVANCED: return "Fortgeschrittene";
>       case BEGINNER: return "Anfänger";
>       case CHILDREN: return "Kinder";
>       case WEAPON:   return "Waffen";
>     }
>     throw new RuntimeException( "unknown enum:"+getClass().getName() );
>   }
> }
> Now i added the listValue- and listKey-parameter:
> <@s.checkboxlist label="Attribute" name="trainingAttributes"  list="%{@domainobjects.util.TrainingAttribute@values()}"
listValue="name" listKey="key"/>
> but no checkbox is checked. Using @s.select with the multiple=true option doesn't prepopulate
either.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message