• 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

List of checkboxes and Array/ArrayList data binding not working.

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

I have a form in which I show list of empId, first name and last name in table form. I want to show checkbox in front of every row and I have Delete button, which when clicked should delete all the employees which are checked.
I tried a lot to bind list of checkboxes to array or ArrayList of empIds. But it does not properly bind it.






When I submit the form, in my form handler I get zero sized empIds list, even though I have checked few checkboxes.

I have tried <form:checkbox /> tag. It bindes, but the chckboxes which are not selected also get submitted with null values. In my code I ignore null, but the problem with tag is I could not find how to show unchecked checkboxes in my first display.
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should do something like the following:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic