带复选框的 Adf 搜索面板
Adf Search panel with checkbox
我在我的搜索面板中添加了一个复选框,如果我 select 复选框并添加一个查询字符串,我在 table 中得到了预期的结果,从某种意义上说,搜索最初是有效的.如果我单击 header 列并尝试对其进行排序,我的 table 将使用过滤掉的结果进行重置。
我发现每次单击排序时都会调用 ViewObject 的 executeQuery。我在这里添加了代码来设置 viewCriteria 属性的值,但 tat 也不起作用。我的 executeQuery 方法包含在下面;
public void executeQuery() {
ViewCriteria vc = this.getViewCriteria("RegionMasterCriteria");
if (null != vc.getCurrentRow()) {
if (null != vc.getCurrentRow().getAttribute("Active") &&
vc.getCurrentRow().getAttribute("Active").equals("true")) {
setActiveVariable("Y");
} else {
setActiveVariable("N");
}
}
super.executeQuery();
}
当我尝试执行搜索时,vc.getCurrentRow() 为空。 Criteria 将自动查询设置为 true,以便在页面加载时 table 具有默认搜索数据。但是为什么 vc.getCurrentRow() 会变成 null..
你可以尝试使用 executeQueryForCollection(java.lang.Object qc, java.lang.Object[] params, int noUserParams)
而不是 executeQuery()?
您将能够在方法参数中找到您的 "Active" 视图条件属性:
java.lang.Object[] params
记住 'params' 是一个矩阵(数组的数组)。
我在我的搜索面板中添加了一个复选框,如果我 select 复选框并添加一个查询字符串,我在 table 中得到了预期的结果,从某种意义上说,搜索最初是有效的.如果我单击 header 列并尝试对其进行排序,我的 table 将使用过滤掉的结果进行重置。
我发现每次单击排序时都会调用 ViewObject 的 executeQuery。我在这里添加了代码来设置 viewCriteria 属性的值,但 tat 也不起作用。我的 executeQuery 方法包含在下面;
public void executeQuery() {
ViewCriteria vc = this.getViewCriteria("RegionMasterCriteria");
if (null != vc.getCurrentRow()) {
if (null != vc.getCurrentRow().getAttribute("Active") &&
vc.getCurrentRow().getAttribute("Active").equals("true")) {
setActiveVariable("Y");
} else {
setActiveVariable("N");
}
}
super.executeQuery();
}
当我尝试执行搜索时,vc.getCurrentRow() 为空。 Criteria 将自动查询设置为 true,以便在页面加载时 table 具有默认搜索数据。但是为什么 vc.getCurrentRow() 会变成 null..
你可以尝试使用 executeQueryForCollection(java.lang.Object qc, java.lang.Object[] params, int noUserParams)
而不是 executeQuery()?
您将能够在方法参数中找到您的 "Active" 视图条件属性:
java.lang.Object[] params
记住 'params' 是一个矩阵(数组的数组)。