wood burning stoves 2.0*
The moose likes Struts and the fly likes check box with html:checkbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "check box with html:checkbox" Watch "check box with html:checkbox" New topic

check box with html:checkbox

Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
how can we copy the html:checkbox value using beanutil.properties?

I mean when I get data from a database a flag value 0 or 1 and based on that how can check or uncheck an html:checkbox?


Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
An <html:checkbox> is tied to the property of the ActionForm bean specified in the property attribute. Assuming this property is a boolean, just set it to true to show the checkbox as checked, and set it to false to show the checkbox as unchecked.

If you have a model bean that has a property with the same name, but type integer and showing a 1 or 0, I believe the BeanUtils.copyProperties() method will correctly map this value to the boolean property as either true or false.

Consultant, Sima Solutions
I agree. Here's the link: http://aspose.com/file-tools
subject: check box with html:checkbox
Similar Threads
html:checkbox mapping
check all checkboxes on clicking one
validation.xml - how to ignore the required fields if a checkBox was clicked?
Iterate tag