PDA

View Full Version : bind a radio button with an enumerated


chuzito
Jan 8th, 2008, 12:59 PM
hi all;

i need help with this issue, i have to display four radio buttons based on a field wich is an enumerated (si, no, siempre, nunca)

here is the jsp

<spring:message code="formaDePago.si"/>
<form:radiobutton path="sumaPunto.nombre"/>
<spring:message code="formaDePago.no"/>
<form:radiobutton path="sumaPunto.nombre"/>
<spring:message code="formaDePago.siempre"/>
<form:radiobutton path="sumaPunto.nombre"/>
<spring:message code="formaDePago.nunca"/>
<form:radiobutton path="sumaPunto.nombre"/>

the html generated is:

Si
<input id="sumaPunto.nombre1" name="sumaPunto.nombre" type="radio" value=""/>
No
<input id="sumaPunto.nombre2" name="sumaPunto.nombre" type="radio" value=""/>
Siempre
<input id="sumaPunto.nombre3" name="sumaPunto.nombre" type="radio" value=""/>
Nunca
<input id="sumaPunto.nombre4" name="sumaPunto.nombre" type="radio" value=""/>

the field is set by default to "no" and always take this value no matter what the user select in the form.

any ideas will be welcome, thanks

Jörg Heinicke
Jan 10th, 2008, 12:02 AM
The HTML is lacking actual values for the value attribute. I guess you have to set those on Spring's radiobutton tags.

Joerg