Create ADF popup for value change event(For select one choice component).
Oracle ADF - Add new custom attribute for view object using Expression
Oracle ADF Client-side Validators
Oracle ADF Association sample for Department and Employee
Monday, May 30, 2011
Oracle ADF - Popup behavior in clientside
Thursday, May 26, 2011
Oracle ADF - Create View Criteria and Execute using Bean.
In this Example shows View Criteria define for BatchId, Filtered records for relevant batch by passing batchId.
1)First thing is you have to create a View Object in mine TraineeVo
2)In TraineeVO Select Query and add bind variable in mine batchId
3)Press + Sign for add View Criteria and make criteria as follows
4)Add method for AppModuleImpl class to execute View Criteria In mine
public void executeTraineeBatchId(String batchId) {
ViewObjectImpl traineeVO = this.getTraineeVO(); //relaventVO
traineeVO.setNamedWhereClauseParam("batchId", batchId); //bindVariable name and pass value
traineeVO.setApplyViewCriteriaName("TraineeVOCriteriaForBatchId"); //criteriaName
traineeVO.executeQuery(); //executeVO with Criteria
}
5)To expose this method to ViewController must add to client interface in AppModule
And press SaveAll
6)Refresh the Data Controls and check whether it available in relevant AppModule
7)Now in View Criteria in data control > TraineeVO > Named Criteria can drag to page as “ADF query panel with Table” but here example is using bean class.
To access View Criteria must “executeTraineeBatchId” bind to page
Click Bindings>+>methodAction>and Create action binding
8)Add InputText and Command button and in Action listener of button get batchId and execute view criteria as follows
public void searchBtnAl(ActionEvent actionEvent) {
String batchId = ""+itBatchId.getValue();//get batchId
if (batchId != null && !batchId.equals("")) {
executeSearchCriteria("executeTraineeBatchId", "batchId", "" + batchId);
}
}
private Object executeSearchCriteria(String sCriteria, String sParamName, String sParamVal) {
BindingContainer bindings = getBindings();
OperationBinding ob = bindings.getOperationBinding(sCriteria);
Map params = ob.getParamsMap();
params.put(sParamName, sParamVal);
return ob.execute();
}
public BindingContainer getBindings() {
return BindingContext.getCurrent().getCurrentBindingsEntry();
}
See Results
Thursday, May 5, 2011
Oracle ADF - Close browser current window using button
FacesContext facesContext = FacesContext.getCurrentInstance();
org.apache.myfaces.trinidad.render.ExtendedRenderKitService service = org.apache.myfaces.trinidad.util.Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
service.addScript(facesContext, "window.close();window.opener.location.href = window.opener.location.href;");