Code for inserting record in Database programmatically.
public String cb2_action() {
// Add event code here...
Row newRow;
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("Commit");
Object result ;
ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("BHCModuleDataControl"); //application name from data controls and not application module
ViewObject myView = am.findViewObject("TempView1"); //view name from data controls
newRow = (oracle.jbo.server.ViewRowImpl)myView.createRow();
newRow.setAttribute("Name", "Amol");
myView.insertRow(newRow);
operationBinding = bindings.getOperationBinding("Commit");
result = operationBinding.execute();
return null;
}
Note: Drag and Drop Commit operation from Datacontrol on jsf page to get Commit binding in page definition.
This blog will cover Oracle ADF, Weblogic, Oracle Application Server, Oracle Collaboration Suite etc....
Wednesday, January 19, 2011
Thursday, January 6, 2011
Navigating between JSF pages programmatically
FacesContext fctx = FacesContext.getCurrentInstance();
Application application = fctx.getApplication();
NavigationHandler navHandler = application.getNavigationHandler();
navHandler.handleNavigation(fctx,null, "name of navigation case");
Application application = fctx.getApplication();
NavigationHandler navHandler = application.getNavigationHandler();
navHandler.handleNavigation(fctx,null, "name of navigation case");
Subscribe to:
Posts (Atom)