Thursday, January 7, 2010

ADF 11g: Execute Operation defined in page defination from backing bean

BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("ExecuteWithParams");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
System.out.println("ERROR");
return null;
}

Thursday, October 29, 2009

Deploy ADF application on weblogic server (10.3)

(prerequisite) Create JNDI on weblogic server
In JDeveloper in
Model-> Rt clk your ApplicationModule file-> Configuration
- Edit both the setting (AppLocal & AppShared)
- Select Connection type to JDBC datasource (default is JDBC URL)
- Give proper DS name e.g java:comp/env/jdbc/MyDS (Note: Same DS name should be thr in weblogic server)
- Follow this for AppShared
- Now, Right clk ur application -> Deploy to EAR file
you can deploy EAR file on WEBLOGIC

Sunday, October 18, 2009

ADF 11g : Failed to lock the record, another user holds the lock.

Change the jbo.lockingmode property to optimistic

Select application module-> rt clik -> Configurations -> Edit -> (Properties tab)
Property: jbo.locking.mode replace pessimistic with optimistic

Sunday, October 4, 2009

1) Programmatically accessing values from managed bean & Programmatically executing view with parameters

UserDetailsPersist obj1 = (UserDetailsPersist)JSFUtils.getFromSession("UserDetailsPersistent");
String startDayNo="";

ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("RotaAppDataControl");
ViewObject vo = am.findViewObject("StartDay");
vo.setNamedWhereClauseParam("locId",obj1.getLocationId());
vo.executeQuery();

while (vo.hasNext())
{
StartDayRowImpl currRecd = (StartDayRowImpl) vo.next();
System.out.println("Now accessing department " + currRecd.getWeekDesc());
startDayNo = currRecd.getWeekDesc().toString();
}

System.out.println("Start day no"+startDayNo);

Wednesday, September 23, 2009

Thursday, September 17, 2009

ADF 11g: SelectOneChoice to display values based upon bind variable view criteria

*) When we have one of the attribute as LOV to other view's column, and we need to define a record based upon some criteria and also our LOV should display values based upon this criteria or BIND VARIABLE do the following.

Whe you create a view delatively,and creating an LOV on one of the attr in 1) overview tab, click on green + sign
2)In edit list of value, against List Data Source click green + sign to open view accessor
3) Shuffle required view object on the right, now this view object has bind variable associated with it so,
4)In View accessor click the Edit button and give the parameter value.

Give the value of this bind variable name of the current attribute to which it is binded so that both the parent and lov values a syncronized.


\

Wednesday, September 16, 2009

ADF 11g: Rowcount from Execute with parameter query programmatically

//Requirement: ADFUtils class,OnPageLoadBackingBeanBase class backing bean extending this(OnPage...) class, override onPageLoad method as below


public void onPageLoad() {
BindingContainer bindings = getBindings();
try
{
OperationBinding operationBinding = bindings.getOperationBinding("ExecuteWithParams");
Object result = operationBinding.execute();
System.out.println("Result"+result);
BindingContainer bindings1 = ADFUtils.getBindingContainer();
DCIteratorBinding dcitr =
(DCIteratorBinding)bindings1.get("Storetimings1View2Iterator");
//Fetch the number of rows returned
long count = dcitr.getDeferredEstimatedRowCount();
System.out.println("Rows returned:: "+count);
if(count == 0) {
OperationBinding operationBinding1 = bindings.getOperationBinding("Createwithparameters");
Object result1 = operationBinding1.execute();
}


}
catch(Exception e) {
System.out.println("The exception");

}

}