2016-12-27 27 views
0

我是ADF的新手,我試圖在我的小ADF Fusion Web應用程序中添加一行到現有的VO。我已經使用我的AppModule的Java類來實現這一點。如何在adf中初始化ViewObject的一行?

所以基本上我有我的任務流程,我打電話給我的AM Java類的下面提到的方法的方法調用,你可以看到如下:

public void assetReturnInitialization(){ 

     System.out.println("Yellow!"); 

     getAstAssetReturnsVO().clearCache(); 
     System.out.println("clearCache Done!");   

     Row row = getAstAssetReturnsVO().createRow(); 
     row.setAttribute("Stat", "test"); 
     getAstAssetReturnsVO().insertRow(row); 
     System.out.println("getAstAssetReturnsVO Done!");      

     getAstAssetReturnsVO().setCurrentRow(row); 
     System.out.println("setCurrentRow Done!");   

     getAstAssetReturnsVO().executeQuery();   
     System.out.println("executeQuery Done!");   

     return ; 
    } 

這似乎是工作,換句話說就好了該頁面開始就像CreateInsert方法已被調用,這正是我想要的,但初始值不是在我已經綁定到VO的組件中設置的。

我什至嘗試調用setCurrent方法,但沒有運氣。

任何幫助是非常感謝它。

謝謝

中號

回答

0

首先嚐試更新組件您已經綁定到VO,通過執行

AdfFacesContext.getCurrentInstance().addPartialTarget(component) 

而是採用VO方法和 - 你也可以嘗試呼叫操作綁定到您的網頁,例如:

dc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 
if (dc != null) { 
    OperationBinding ob = dc.getOperationBinding("CreateInsertMyTable"); 
    if (ob != null) 
     ob.execute(); 

ps這應該從Vi完成ewController項目

+0

好的工作謝謝。但是,我該如何獲取組件對象,其次我如何獲得對應於「CreateInsertMyTable」的正確值? –