This is how I did it.  I used JSTL instead of Struts HTML tags, but I guess
you can just as easily use html-el tags.

My form object is defined in the struts-config.xml file as....

                <form-bean name="form"
type="org.apache.struts.action.DynaActionForm">
                        <form-property name="object" type="project.Form[]"
size="10"/>
                </form-bean>


And my table code is .....

<display:table name="requestScope.form.object" id="row"
requestURI="action.do" >
        <display:column title="Value" >                 
                                <input type="checkbox" name="row[<c:out
value="${row_rowNum - 1}"/>].value" value="1" <c:if
test="${row.value}">checked</c:if> />
        </display:column>
</display:table>


I have the variables in my form set as booleans and defaulted to "false".  

I hope this helps.

> -----Original Message-----
> From: Carolina Dolan [SMTP:[EMAIL PROTECTED]
> Sent: Thursday, April 22, 2004 9:59 AM
> To:   [EMAIL PROTECTED]
> Subject:      [displaytag-user] Using Checkboxes
> 
> Hi everybody!
> 
> I'm in desperate need for help. I have to use checkboxes and I haven't
> been able to do it. I'm using struts in my jsp. This is what I've tried:
> 
> <display:table name="MyForm.batches" scope="session" class="report"
> id="batch" >
>       <display:column title="" align="center" >
>               <html:checkbox name="batch" property="checked" value="on"/>
>       </display:column>
>       ...
> </display:table>
> 
> The problem that I have is that with such code it shows the original value
> correcly -- so I know it recognizes the variable -- but it doesn't change
> when I submit the page with the selections made.
> 
> I know there've been a bunch of e-mails about this same topic, but I found
> this mailing list today, and I couldn't see the complete messages from the
> archive. If anybody can hep me I'll be more than grateful!
> 
> Thanks a lot!
> 
> Carolina
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
> _______________________________________________
> displaytag-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/displaytag-user


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to