You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by yamilka vallejo ramos <ya...@gmail.com> on 2006/09/27 15:13:13 UTC

Problems Checking and Array of html:checkbox

Please I have and Array of html:checkbox, but that array it of Long[] and I
don't kwon how to say checked = true


<c:forEach items="${listadoTiposDonante}" var="tipoDon">

<table>
<tr>
<td><html:checkbox property="tipoDonante" value="${tipoDon.id}"/></td>
<td class="textoEtiquetasIzquierda"><c:out value="${tipoDon.etiqueta
}"/></td>
</tr>
</table>

</c:forEach>

every element "tipoDon" of my list "listadoTiposDonante" has a boolean and I
dont kwon how too work with that

please if any boby could help me i will presure, thanks

Re: Problems Checking and Array of html:checkbox

Posted by Uday Chandra Karrothi <ud...@gmail.com>.
Here is peace of code that i used .

It uses a strign array to set the checkboxes and then get the values(
in action form) selected as well.Have you tried using a multibox.

<logic:iterate id="apprEnEntry" name="ecnEntryEnList" indexId="apprIndex">
.....
    <td align="center" nowrap>&nbsp;&nbsp;<b><bean:write
name="apprEnEntry" property="label"/>&nbsp;&nbsp;</b></td>
      <td> <html:multibox property="selectedAssets">
	     <bean:write name="apprEnEntry" property="label"/>
	  </html:multibox>
	  </td>
   ...
 </logic:iterate>

selectedAssets is an array that you can populate with the values

so yeah
Basically try using multibox. I hope that will help you in settign and
getting the values of the checkboxes.

Thank you
Uday




On 9/27/06, yamilka vallejo ramos <ya...@gmail.com> wrote:
> Please I have and Array of html:checkbox, but that array it of Long[] and I
> don't kwon how to say checked = true
>
>
> <c:forEach items="${listadoTiposDonante}" var="tipoDon">
>
> <table>
> <tr>
> <td><html:checkbox property="tipoDonante" value="${tipoDon.id}"/></td>
> <td class="textoEtiquetasIzquierda"><c:out value="${tipoDon.etiqueta
> }"/></td>
> </tr>
> </table>
>
> </c:forEach>
>
> every element "tipoDon" of my list "listadoTiposDonante" has a boolean and I
> dont kwon how too work with that
>
> please if any boby could help me i will presure, thanks
>
>


-- 
Never explain--your friends do not need it and your enemies will not
believe you anyway--Elbert Hubbard

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