问题
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 ?
回答1:
You likely need to setup the partial triggers on the table, or possibly the surrounding container, to actually force a screen update.
回答2:
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
来源:https://stackoverflow.com/questions/14482629/what-is-the-api-to-clear-selection-on-a-aftable