aspose file tools*
The moose likes Struts and the fly likes problem with struts checkboxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with struts checkboxes" Watch "problem with struts checkboxes" New topic
Author

problem with struts checkboxes

Anitha Kuchana
Greenhorn

Joined: Dec 22, 2011
Posts: 21
I am using struts my check boxes are in list .that listed values are iterate in my JAVA SERVER PAGE .That check boxes are displayed.My jsp page having two text fileds and this check boxes are there.at that time i am not giving the text box values but i gave the check box values after submission ,there is a struts error message came but my check box values are not saved is there any solution to over come this problem in struts.when i gave all the values i submitted successfully in database. what ever we checked the check box values after getting the we getting error message that check box values are saved.please any one help me.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

So, what I understood is when you enter all the details and submit, everything works fine. But when yo don't enter text field values it generates an error. Could we show the part of the code, that retrieves the values and stores in database.


Swastik
Anitha Kuchana
Greenhorn

Joined: Dec 22, 2011
Posts: 21
my problem is not with text filed .It is problem with check box .I detected error message in my jsp page at that time what ever i checked before that values are unchecked.i think now you understand my problem.please help me!
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Do you mean your text box values are saved, but check box values are not saved in database even if check the check boxes?
Anitha Kuchana
Greenhorn

Joined: Dec 22, 2011
Posts: 21
in my jsp page two text box and three check boxes are there.when not given values for text boxes but i checked the check box values then i submit at that time check box values are unchecked at that time there is a validation error message came.After submit also what ever i checked that checked values are appear .
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

OK, let me clarify it one more time. You don't enter any values in text box, you check the check boxes, you submit the form and it shows validation error. After this when you are coming back to the first page, you find the check boxes are unchecked. Is this the case?
Anitha Kuchana
Greenhorn

Joined: Dec 22, 2011
Posts: 21
yes..can please tell me why that is happening.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

I believe it's natural to happen, unless check box values are persisted in scoped variables.
Anitha Kuchana
Greenhorn

Joined: Dec 22, 2011
Posts: 21
how to solve this problem in struts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with struts checkboxes