[EMAIL PROTECTED]

| Yes, but to clarify...
| I am showing a jsp page with values read from a database. If the
| checkbox value is true, how do I then make the checkbox on my jsp-page
| checked and how do I then find out if the checkbox has been unchecked?
| Do I have to manually read the posted data and see if the checkbox
| attribute is missing or is there a better way?

I assume that you are using an Action with an ActionForm.

To make the value of the checkbox come up correctly, import
struts tags into your jsp-page: 

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="strb" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="strh" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="strl" %>

Then use the Struts checkbox tag:

<strh:checkbox property="done"/>

Assuming that your form has the methods getDone and setDone,
these methods will be used to render the value of the checkbox
correctly.

As to the question of boolean values that are set to false by the
user: You don't have to parse the posted data manually.  The
method reset() in ActionForm is run before the posted data is
used to populate the form.  Write your own reset() method where
you set the boolean fields to false.

-- 
mvh

Tor Henrik Hanken

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

Reply via email to