Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

[checkbox] can't get even checked values

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

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.
We must storm this mad man's lab and destroy his villanous bomb! Are you with me tiny ad?
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic