You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "zhouyanming (JIRA)" <ji...@apache.org> on 2006/11/24 12:10:57 UTC

[jira] Created: (WW-1519) 'select' tag cannot bind jdk5.0 enum type

'select' tag cannot bind jdk5.0 enum type
-----------------------------------------

                 Key: WW-1519
                 URL: http://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


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.toString()',It works fine now,I think this problem also existed in webwork2



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (WW-1519) 'select' tag cannot bind jdk5.0 enum type

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

Don Brown resolved WW-1519.
---------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.0.8)
         Assignee: Don Brown

>From what I can tell, this has already been fixed.  I added the unit test SelectTag.testEnumList and it seems to work just fine. Please reopen with a patch if the test doesn't properly replicate it.

> '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
>         Assigned To: Don Brown
>            Priority: Minor
>
> 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.


[jira] Updated: (WW-1519) 'select' tag cannot bind jdk5.0 enum type

Posted by "zhouyanming (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/WW-1519?page=all ]

zhouyanming updated WW-1519:
----------------------------

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



  was:
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.toString()',It works fine now,I think this problem also existed in webwork2




> 'select' tag cannot bind jdk5.0 enum type
> -----------------------------------------
>
>                 Key: WW-1519
>                 URL: http://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
>
> 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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WW-1519) 'select' tag cannot bind jdk5.0 enum type

Posted by "Rainer Hermanns (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Updated: (WW-1519) 'select' tag cannot bind jdk5.0 enum type

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

Ted Husted updated WW-1519:
---------------------------

    Fix Version/s:     (was: Future)
                   2.0.7

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