It's not a secret anymore!
The moose likes Struts and the fly likes Struts - Checkbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts - Checkbox" Watch "Struts - Checkbox" New topic

Struts - Checkbox

S Krishnan

Joined: Aug 22, 2005
Posts: 5

I came through scenario where the checkbox doesnt work as expected.

When the check box is selected, it is identified. But when I display the box in the next screen (which should display the selection), the selection is not rendered.

What could be the possible reason.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
There are a number of things that could go wrong. I'd suggest you show us the relevant code fragments in your JSP and form bean. Are the data in all the other controls being display ok, and the checkbox is the only one that isn't?

Consultant, Sima Solutions
vijaya bharath
Ranch Hand

Joined: Jun 10, 2005
Posts: 66

Even i faced this problem in my application
What i did was i send the value as hidden property when it is checked
And at <html:checkbox > we should apecify the value attribute as true
That is when we check it shud return true.
Once we checked and set the value and redisplay the form now it is showing checked in my appl. Its better if u send u r code. Then we can find what's the problem is

Regards,<br />Vijaya Bharath.<br />SCJP1.4 <br />SCWCD5.0
I agree. Here's the link:
subject: Struts - Checkbox
jQuery in Action, 3rd edition