What is the api to clear selection on a af:table?

一世执手 提交于 2019-12-11 10:57:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!