aspose file tools*
The moose likes Struts and the fly likes html:checkbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:checkbox" Watch "html:checkbox" New topic
Author

html:checkbox

rudresh kumar
Ranch Hand

Joined: Jan 04, 2006
Posts: 83
HI All,

I have few checkboxes in my jsp, intially it is unchecked and after the user checks , the values are there and stored in database too, it is working fine no issues

But when a user checks the check box and again unchecks it, now after submitting the page the user can see that the check box is still checked, which he had unchecked earlier.

This is built on struts and i have formbean where in i put all the form values (get/set methods) and this is in session scope.
I had tried various options like reset method and others suggested in net, but could not find a solution,

I can add a hidden field and handle it in javascript, but that solution is difficult now as i need to create get/set for all fields and in front end addtions and that too for some 50 checkboxes doing this solution, i believe is not the correct way.

I request some one can help me out on this

Thanks
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
My questions would be about what code is being executed when the user submits the page and how the page is redisplayed. I suggest that you post your action mappings, action class, form class and relevant jsp code.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:checkbox
 
Similar Threads
PreCheck the Checkbox of struts
JSF multiple check box and single array list in backing bean
Struts 2.1.6: Checkbox does not post unchecked values
"checked" property of a html:checkbox field ... ?
checkboxes persistence