wood burning stoves 2.0*
The moose likes JSF and the fly likes JSF - Passing value from a SelectBooleanCheckBox to a command button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF - Passing value from a SelectBooleanCheckBox to a command button" Watch "JSF - Passing value from a SelectBooleanCheckBox to a command button" New topic
Author

JSF - Passing value from a SelectBooleanCheckBox to a command button

Desai Bhagya Lakshmi
Greenhorn

Joined: Apr 21, 2008
Posts: 9
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

Joined: Jun 25, 2001
Posts: 16067
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: JSF - Passing value from a SelectBooleanCheckBox to a command button