You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Rainer Hermanns (JIRA)" <ji...@apache.org> on 2007/04/19 17:25:43 UTC
[jira] Commented: (WW-1519) 'select' tag cannot bind jdk5.0 enum
type
[ https://issues.apache.org/struts/browse/WW-1519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40849 ]
Rainer Hermanns commented on WW-1519:
-------------------------------------
The suggested patch does not work for non-enum scenarios.
This needs further investigation...
> 'select' tag cannot bind jdk5.0 enum type
> -----------------------------------------
>
> Key: WW-1519
> URL: https://issues.apache.org/struts/browse/WW-1519
> Project: Struts 2
> Issue Type: Bug
> Components: Views
> Affects Versions: 2.0.1
> Environment: null
> Reporter: zhouyanming
> Priority: Minor
> Fix For: 2.0.8
>
>
> public enum Status {
> INIT("init"), COMPLETED("completed");
> private String displayName;
> Status(String displayName){
> this.displayName=displayName;
> }
> public String getName(){
> return name();
> }
> public String getDisplayName(){
> return displayName;
> }
> }
> public class TestAction extends ActionSupport {
> private Status stauts = Status.COMPLETED;
> public List<Status> getStatusList() {
> return Arrays.asList(Status.values());
> }
> public String input() {
> return INPUT;
> }
> }
> <s:select label="%{getText('status')}" name="status" list="statusList" listKey="name" listValue="displayName" />
> this tag doesn't bind value 'COMPLETED',the problem can resolved by modify the template file of select tag.
> in file template/simple/select.ftl line 32 and line 53,change 'parameters.nameValue' to 'parameters.nameValue?if_exists?string',It works fine now,I think this problem also existed in webwork2
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.