You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Benedict <pb...@apache.org> on 2009/07/02 20:03:48 UTC

Re: Form survey problem (html:radio)

Did you try removing indexed="yes" ?

On Fri, Jun 19, 2009 at 5:05 PM, Luis Ureña<lu...@gmail.com> wrote:
> I am working in a survey form with several questions. Each question can have
> several options. That options are builded with an iterate. When I execute
> the page generate one radio button name. If I add the indexed="Yes" property
> for the html:radio this generate one radio button name for all the first
> option for all the questions, another radio button name for all second
> options for all questions, and so on.
>
> <tr>
>    <td>
>        <input type="radio" name="opcion[0].name" value="1">pangea
>        <input type="radio" name="opcion[1].name" value="2">oceania
>        <input type="radio" name="opcion[2].name" value="3">panthalasa
>        <input type="radio" name="opcion[3].name" value="4">euroasiatico
>        <input type="radio" name="opcion[4].name" value="4">De relleno
>    </td>
> </tr>
> <tr>
>    <td>
>        <input type="radio" name="opcion[0].name" value="3">Arcaicas
>        <input type="radio" name="opcion[1].name" value="2">Nuevas
>        <input type="radio" name="opcion[2].name" value="1">Viejas
>    </td>
> </tr>
>
>
> I need generate one radio button name for all options for the first
> question. Another radio button name for all options for the second question
> and son on.
> (unicaBean is the bean that I put into the request. opciones bean is a
> Collection into unicaBean)
>
> This is the JSP:
> <logic:iterate id="unicaBean" name="unicaBean">
>    <TR id="trdark">
>        <TD>
>            <html:hidden name="unicaBean" property="seccion"/>
>            <html:hidden name="unicaBean" property="pregunta"/>
>            <bean:write name="unicaBean" property="descPregunta"/>
>        </TD>
>    </TR>
>    <TR id="trclear">
>        <TD>
>            <table class="tableinfo">
>                <tr>
>                    <td>
>                        <logic:iterate id="opcion" name="unicaBean"
> property="opciones" indexId="pregunta">
>                            <html:radio name="opcion" property="name"
> value="id" idName="opcion" indexed="true"/>
>                            <bean:write name="opcion" property="name"/>
>                        </logic:iterate>
>                    </td>
>                </tr>
>            </table>
>        </TD>
>    </TR>
> </logic:iterate>
>
>
>
> Somebody know how do it?
>
> Thanks
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org