@UiHandler("flexTable") protected void onFlexTableClicked(ClickEvent event) { removeSelectedRowStyleFromTable(); Cell cell = flexTable.getCellForEvent(event); if (cell != null && totalCount != 0) { int row = cell.getRowIndex(); selectedIndex = row; flexTable.getRowFormatter().addStyleName(row, selectionStyle.rowHighlighted()); RadioButtonContainer radioButtonContainer = radioButtons.get(row); if (radioButtonContainer != null && radioButtonContainer.getRadioButton() != null) { clearRadioButtons(); radioButtonContainer.getRadioButton().setValue(true); selectedRowId = radioButtonContainer.getIdentifier(); if (listner != null) { listner.onRowSelected(selectedRowId); } } if (radioButtonContainer != null && radioButtonContainer.getRadioButton() == null && radioButtonContainer.getIdentifier() != null) { selectedRowId = radioButtonContainer.getIdentifier(); } } }
private void clearRadioButtons() { for (RadioButtonContainer radioBtnContainer : radioButtons.values()) { radioBtnContainer.getRadioButton().setValue(false); } }