Yep. Scratch the indexed properties comment.
On each iteration, Struts will iterate over the
selectedServices comparing the selectedServices value
to the service.status value. If it finds a match, then it
will render the checkbox as checked. So, the fact that the
data structures are not the same size isn't a factor.

In Rick's example, he compares String to String. You may be 
able to compare int to String or boolean to String because I think BeanUtils 
performs
simple conversions for you, but byte to String... I don't know.


robert

> -----Original Message-----
> From: andy wix [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 15, 2004 12:59 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Use JSTL with html:multibox tag
> 
> 
> Hi,
> 
> Thanks for the input Robert, but the array will be shorter than the 
> arraylist whenever a checkbox is not selected.
> 
> I've had a look at Rick Reumann's Struttin with Struts lesson 3 which does 
> something similar and now have:
> 
> <c:forEach var="service" items="${services}" varStatus="status">
>   <TR>
>     <TD><c:out value="${service.name}"/></TD>
>     <TD
>     <html:multibox name="serviceForm" property="selectedServices"><c:out 
> value="${service.status}"/>
>   </TD>
> 
>   </TR>
> </c:forEach>
> 
> This is a step in the right direction but still doesn't work (the checkboxes 
> aren't checked when viewing the page even though they should be set).  The 
> service.status field in the service class is a byte - does this have to be a 
> String?
> 
> Cheers
> Andy
> 
> _________________________________________________________________
> It's fast, it's easy and it's free. Get MSN Messenger today! 
> http://www.msn.co.uk/messenger
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to