问题
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