How to refresh table within a popup in dialog window in ADF Oracle 11gR1

谁都会走 提交于 2020-01-04 06:30:24

问题


I'm working on a requirement to show a popup window with search table in it. As the user clicks on the search button (with input text boxes provided) in the popup window the search table needs to be refreshed with new set of data.

I've created a populateSearchTable() method to generate the table by populating the values in an Array deviceListArray<POJO CLass>.

In populatesearchTable() every time I generate the data I'm trying to clear the deviceList Array by deviceListArray.Clear() method and also used the below method to refresh the table at the end of it.

 AdfFacesContext.getCurrentInstance().addPartialTarget(<tableBindingVariable>)

For some reason the table does not get refreshed. Let me know if I need to share my code.

Is there any other way to refresh a table with in a popup which is different from normal refresh method.


回答1:


After declaring your list and creating the setter and getter.

List<String> myList= new ArrayList<String>();

when you do the search, fill the list with the result data , then put it in the ProcessScope like

for(....){

mylist.add(....)
}     

AdfFacesContext.getCurrentInstance().getProcessScope().put("mylist", mylist);

Rewrite the get method for the list to as follows :

public List<String> getMyList() {
        myList.clear();
        List<String> list = (List<String>) AdfFacesContext.getCurrentInstance().getProcessScope().get("myList");
        if (list != null) {
            for (String var : list) {
                myList.add(var);
            }
        }
        return myList;
    }

And make sure to set the value for the table to the list :

  <af:table value="#{SomeBean.myList}" var="row" rowBandingInterval="0" ..... />

Regards

Salam... :)



来源:https://stackoverflow.com/questions/41201592/how-to-refresh-table-within-a-popup-in-dialog-window-in-adf-oracle-11gr1

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