Announcement Announcement Module
Collapse
No announcement yet.
A question about <form:radiobutton/> binding to Enum Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • A question about <form:radiobutton/> binding to Enum

    Hi all,

    I use <form:radiobutton/> which should be binded to an Enum. My jsp looks as follow:
    Code:
    ...
    <table>
    	<tr>
    		<td>Doctor<form:radiobutton path="title" value="Dr"/></td>
            <td>Professor<form:radiobutton path="title" value="Prof"/> </td>
    	</tr>
           ...
    </table>
    And the Enum class looks as follow:
    Code:
    public enum Title{
    
        Dr,
        Prof;
    
        public String value() {
            return name();
        }
    
        public static Geschlecht fromValue(String v) {
            return valueOf(v);
        }
    
    }
    And my ActionForm looks as follow:
    Code:
    public class MyActionForm implements Serializable {
    ...
    private Title title;
    ...
    setter and getter
    ...
    }
    But it doesn't take the value from the radio button.

    Someone can help?

  • #2
    Have you searched the forum??
    http://forum.springframework.org/sho...ight=bind+Enum

    Comment


    • #3
      I solved my problem in a simple way than that in the link you show me.

      Thanks.

      Comment

      Working...
      X