• 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

JSF 1.2 Inner Datatable selectBooleanCheckBox - Selected options wrongly reflected in the Bean

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a scenario where I have to give an option to the user to select Applications and its related Profiles. The user should select at least one Application and One Profile and he can also select more than one. Each Application has its own Profiles and there can be multiple applications. My UserBean has a List of ApplicationVO and that ApplicationVO has selected (boolean), application id (int), application name(String) and Profile List. That Profile list has List of ProfileVO and ProfileVO has selected(boolean), profile id(int) and Profile name(String).

I am new to JSF and am using datatable and SelectBooleanCheckBox. When the user selects few Profile checkbox and submits, the UserBean Profile list is updated with wrong selected options. In other words, the checkboxes selected in the UI is different and the ProfileVO.isSelected() value doesnt match with the UI selection. Here is the code:

JSF:

UserBean:


After submitting the page, I tried to iterate the applicationList in UserBean and found the UI selection didnt match. I am new to JSF so any help is appreciated. Thanks

EDIT: Added code tagsa
 
Solomon Gnanadurai
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found that when the controls are rendered in the jsp page at runtime, JSF ordered the list by application id and profile id in my case. So instead of making JSF to order it, I sorted it and it all worked fine.
 
reply
    Bookmark Topic Watch Topic
  • New Topic