• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF - Passing value from a SelectBooleanCheckBox to a command button

 
Desai Bhagya Lakshmi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everbody,

I have a check box in one of the column of a data table (The datatable contains many records). I would like to find out, which check box has been clicked by the user.Here event has to take place when we select the check box.The method what is backing bean is not going to call.
There is a command button below the datatable. (The user will first click on the check box and then click on the command button). In the command button's method, I would like to know how many checkboxes has been clicked.
Any help is appreciated.

Thanks in Advance
Bhagya
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18282
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The check box should have its value bound to a boolean backing bean property. In fact, it has to be for JSF to use it.

When you click the command button and your command action method is invoked, the properties bound to the check boxes will reflect which boxes were/weren't checked at the time you clicked the command button.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic