默認情況下,ADF的table組件 會在頁面加載時,運行綁定的query,返回一個結果集。但有些頁面不需要table自動執行綁定的view object的query,比如說一個查詢頁面,在沒有輸入查詢條件的情況下,不希望自動執行默認的SQL,這樣有可能會使最終用戶迷惑。今天研究了下,比較正確的方式是在進入該頁面前,先執行viewobject的executeEmptyRowSet()方法。
可以先創建一個ViewObjectImpl擴展類:
package com.xy.scpms.model.common;
import oracle.jbo.server.ViewDefImpl;
import oracle.jbo.server.ViewObjectImpl;
public class NoAutoQueryView extends ViewObjectImpl {
public NoAutoQueryView(String string, ViewDefImpl viewDefImpl) {
super(string, viewDefImpl);
}
public NoAutoQueryView() {
super();
}
public void clearRowSet(){
executeEmptyRowSet();
}
}
然後在一個View中選擇Extend這個類,並在ViewObject的 client interface中加入該方法,使其可以在taskflow中被調用。
最後在taskflow中,將該方法作爲一個method
call Activity 放在頁面之前執行。