문제

In my App (Fusion Web) exist a ViewObject from Oracle DB. I created the java classes and build a specific method (makeUniqueSearchByDate(String)) to process the data. This method appears in "Data controls" that I can drag to the "view" and use as any other function. When I try to use it in a "bean" (instead of dragging directly):

public void setDate(ActionEvent actionEvent) {
        ApplicationModule appMod =
            Configuration.createRootApplicationModule("com.svr.model.AppModule", "AppModuleLocal");

        ViewModelosByDataImpl fo = (ViewModelosByDataImpl) appMod.findViewObject("ViewModelosByData1");
String dateV = "07-01-2013";
fo.makeUniqueSearchByDate(dateV);
}

This code has no effect on the table. Can anyone see why? Btw, the program does not throw any exception. Just does not work. The table remains the same. But if I use the button, automatically generated by "drag and drop" the function runs normally. I know I should study ADF, but unfortunately I have no time.

도움이 되었습니까?

해결책

i think after you have exposed the method written at VO as Client interface, you need to create a method binding in pageDef file of you page. after creating the method binding, you need to access the method in bean through binding layer something like this :

OperationBinding op=((DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry()).getOperationBinding("Method Binding"); op.execute();

i think the method used by you to call VO method from bean is not right.

i think one more thing you need to do in your bean after calling the VO method is that you need to do refresh the table / perform PPR programatically :

AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance(); adfFacesContext.addPartialTarget(component binding for your table component);

you can try setting autosubmit to true for command button which invokes action event, and set partial trigger for table to component id of the command button.

can you post VO method code as well ? does the method get called and data gets committed / updated when you execute it through bean ? is it only a table refresh issue ? do you see changes to data if you manually refresh the page ?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top