Show TOC

Syntax documentationonRowSelection Locate this document in the navigation structure

The event is fired when the user clicks on the radio button in the first column. The radio button is visible when the 'selectionMode' is set to "SINGLESELECT".

Example

using the taglib

Syntax Syntax

  1. import com.sap.htmlb.enum.TableSelectionMode;
    ..
    
    /* Get the tableView component */
        TableView table = (TableView) this.getComponentByName("myTableView");
    
        /* Set the onHeaderClick event */
        table.setSelectionMode(TableSelectionMode.SINGLESELECT);
        table.setOnRowSelection("onRowSelClick");
        ..
    
        /*  the method onRowSelClick has to be declared in the DynPage.
    
            Otherwise an exception is thrown ("method not found") when the
    
            user clicks on the radio button of the tableView.
    
            Declaring onHeaderClick: */
    public void onRowSelClick(Event event) {
        System.out.println("Row selection click");
    }
    
End of the code.
onClientRowSelection

The selected row can also be determined on the client by using the htmlbevent object.

For JS there are a few API calls available to get to the key.

JavaScript Example:

htmlbevent.obj.getClickedRowKey();

For more information see JavaScript API.