如何在 ADF Oracle 11gR1 的对话框窗口中的弹出窗口中刷新表 [英] How to refresh table within a popup in dialog window in ADF Oracle 11gR1

查看:50
本文介绍了如何在 ADF Oracle 11gR1 的对话框窗口中的弹出窗口中刷新表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个要求,以显示一个带有搜索表的弹出窗口.当用户点击弹出窗口中的搜索按钮(提供输入文本框)时,搜索表需要用新数据集刷新.

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.

我创建了一个 populateSearchTable() 方法,通过填充数组 deviceListArray 中的值来生成表.

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

populatesearchTable() 中,每次生成数据时,我都尝试通过 deviceListArray.Clear() 方法清除 deviceList 数组,并使用以下方法最后刷新表格.

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.

推荐答案

在声明您的列表并创建 setter 和 getter 之后.

After declaring your list and creating the setter and getter.

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

当你进行搜索时,用结果数据填充列表,然后将其放入ProcessScope 喜欢

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);

将列表的get方法改写如下:

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" ..... />

问候

萨拉姆... :)

这篇关于如何在 ADF Oracle 11gR1 的对话框窗口中的弹出窗口中刷新表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆