• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[checkbox] can't get even checked values

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo,
I know about the html-"feature" of submitting only checked boxes and the struts-solution to use the reset() in my FormBean, but I although have some problems:

My FormBean "userManagementForm" has a Set "allUsers" with Beans. These Beans have 2 properties: readingPermitted and writingPermitted. I access them in my jsp via:



I prepolulate my checkboxes with values from my DB. This works great. These values are submitted correctly, but only these prepopulated values. If I check an unchecked checkbox, this one is not submitted. So I get always the checkbox-values that I used to prepopulate this form. The above happens if I don't implement the reset().
If I do implement the reset() and set all properties in all Beans to false and then debug my userManagementForm in the execute() of my UserManagementAction, it has only false-values for all properties.

Any suggestions what I'm doing wrong?

smo
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That makes me think it's NOT submitting correctly, for any of the values, ever.

Your ActionForm needs a setReadingPermitted and a setWritingPermitted method which take a String[] parameter.

Let us know if you've those 2 methods.
 
reply
    Bookmark Topic Watch Topic
  • New Topic