Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/03/2008, 20:06
tripero
 
Fecha de Ingreso: marzo-2008
Mensajes: 1
Antigüedad: 17 años
Puntos: 0
Struts - Propiedad indexed= true - capturar valores

Hola estoy usando struts y tengo el siguiente problema:

Tengo una tabla con 10 filas y por cada fila hay un select con 3 posibles valores, lo que yo necesito es logicamente obtener cada valor del select por cada fila, el tema es que en el action me devuelve un arreglo vacio y no entiendo bien porque.



struts-config.xml

<form-bean name="registrarBoletaForm"
type="org.apache.struts.validator.DynaValidatorFor m">
<form-property name="resultadoFinal" type="java.lang.Integer[]" size="10"/>
</form-bean>



presentarBoleta.jsp

<html:form action="/registrarBoletaUsuarioSubmit" method="post">
<table class="tabla" width="276px">
<tr class="encabezado">
<th>Local</th>
<th>Visitante</th>
<th>Resultado</th>
</tr>

<logic:iterate id="partido" name="partidos">
<tr class="fila">
<bean:define id="visitante" name="partido" property="equipoVisitante"/>
<bean:define id="local" name="partido" property="equipoLocal"/>
<bean:define id="idpartido" name="partido" property="id"/>

<td class="fila"><bean:write name="local" property="nombre"/></td>
<td class="fila"><bean:write name="visitante" property="nombre"/></td>

<td>
<html:select indexed="true" name="partido" property="resultadoFinal" value="1"> <-- estara bien esto

<html:option value="0">Local</html:option>
<html:option value="1">Empate</html:option>
<html:option value="2">Visitante</html:option>
</html:select>
</td>
</tr>
</logic:iterate>

</table>
<br>
<html:submit value="¡Apostar!" styleClass="botonApuesta" />
</html:form>





RegistrarBoletaUsuarioAction




public class RegistrarBoletaUsuarioAction extends Action {

@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {

DynaActionForm f = (DynaActionForm) form;

Integer[] result = (Integer[]) f.get("resultadoFinal");

<!-- result esta vacio-->



Cualquier sugerencia sera mas que bienvenida porque estoy al limite con el tiempo, gracias



saludos