how to save the selected values by using the "Select Row Checkbox"?

Hi All,

I have a problem while using the “Select Row Check box”

My scenario:

I have a table with two columns.
One column displays some list of item names and another column will displays a check box to select/unselect [Select Row Check box].

When even i selects a check box i want to append the item name(s) to an string or array list.

Can anyone help me on this.

Thanks in advance,

If you need to respond to the selection events on the client side without a round trip to the server, you can attach a row change listener to the table control with a custom function in a script block that gets called when a row select occurs.

For example:

CAF.model("#{caf:cid('yourTableIdHere')}".addRowChangeListener(function(tableId,rowId,eventType) {
    if (eventType == "select") {
        alert('Row Selection Changed for Row: ' + rowId);

Or if you want to get the selected rows on the server side inside of an action handler method, you can use the methods on the selectable content provider object.


For example:

ISelectableTableContentProvider tableContentProvider = [TODO_get_your_table_content_provider_here];
Collection selectedRowIds = tableContentProvider.getRowSelectedIds();

Hi Eric Norman,

Thanks your help.

I want the selected values on click of some button [Ex: Ok]. I have used the 2nd example and it is listing all the selected values.

Once again thanks for your help.


Hi Norman,

I am currently using the 9.8 version and i am trying to clear the selected rows from the server side, but i could not succeeded.

Below is the code i am using to push the selected rows to the another custom ArrayList.

getPlacedOrderDetails().add((caf.war.SAGInternalSystems.wsclient.enquireecafelist.SAG_ECAFEWsEnquireECafeListStub.OrderDetails) getEnquireECafeTableProvider().getSelectedRows().

later i have used the below code to clear the selected items.


Unfortunately , above code throws some error as below.


Please help me out from the above error, or do we have any other way to remove the values from the selected array bean from the server side.

Thanks in advance.

The selected rows list is immutable.

If you want to clear the selected rows, you should call the setRowSelectedIds method and pass it an empty list.

for example: