• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

input type="checkbox" boolean value

 
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I've got a form where I'm trying to load the parameterMap into a business object automatically using the BeanUtils class.

I can get everything to work but two form fields which are checkboxes w/ a value="true". It should load two setters in my class called "setIsAtLunch(boolean arg)" and "setIsInOffice(boolean arg)"...but it skips these two, presumably because they are booleans and somehow it isn't translating in the BeanUtils.populate() method.

I've named the form fields "isAtLunch" and "isInOffice" respectively so according to the JavaBeans spec, it should capture them just fine.

If I pull them out and wrap them w/ Boolean.parseBoolean() they work just fine...but I *really* would rather use BeanUtils - and I wouldn't imagine that it couldn't handle any form field type.

Any ideas?

Thanks!
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic