You likely need to setup the partial triggers on the table, or possibly the surrounding container, to actually force a screen update.
What is the api to clear selection on a af:table?
-
17-01-2022 - |
Frage
I have a two ADF faces table say A
and B
and their rowSelection
property is is set to "single
". Now the requirement is when one row is selected from A
, it should clear out all selections from B
and vice versa . So I have registered selectionListeners
on both the tables and the code that gets executed inside that method is doing the following for the table that has not been selected :
tablenNotSelected.setSelectedRowKeys(null);
What am I missing here ?
Lösung
Andere Tipps
Don't set the selected row keys to null. Instead use the getSelectedRowKeys().RemoveAll();
API.
To get the other table refreshed do the following.
table_1_selectionListener() {
RequestContext.getCurrentInstance().addPartialTarget(T2);
}
Similar for table 2 listener
public void clearTableSelection(RichTable table) {
table.getSelectedRowKeys().clear();
RowKeySetAttributeChange rks = new RowKeySetAttributeChange(table.getClientId(), "selectedRowKeys", new RowKeySetImpl());
RequestContext.getCurrentInstance().getChangeManager().addComponentChange(FacesContext.getCurrentInstance(),table, rks);
AdfFacesContext.getCurrentInstance().addPartialTarget(table);
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow