Oracle Fusion Middleware Blog by - Mohammed Tanveer
This blog will cover Oracle ADF, Weblogic, Oracle Application Server, Oracle Collaboration Suite etc....
Tuesday, February 23, 2016
UI Component Reference & PartialTarget
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
UIComponent component = JSFUtils.findComponentInRoot("pgl3");
adfFacesContext.addPartialTarget(component);
UI Refresh based on data in model
You will have to execute iterator
public String cb2_action() {
// Add event code here...
//AdfFacesContext adffacesctx = AdfFacesContext.getCurrentInstance();
//adffacesctx.addPartialTarget(JSFUtils.findComponentInRoot("t1"));
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
bindings.refreshControl();
DCIteratorBinding iterBind= (DCIteratorBinding)bindings.get("TemplateIterator");
iterBind.executeQuery();
iterBind.refresh(DCIteratorBinding.RANGESIZE_UNLIMITED);
return null;
}
Component Reference
One way to get component reference is use JSFUtils
UIComponent component = JSFUtils.findComponentInRoot("contextPopup");
Another way is below
We should not have any Rich component in backing bean because of serialization and memory issues
Sample of popup binding changed to component reference
private ComponentReference conflictReadOnlyPopup;
The getter and setter looks like
public void setConflictReadOnlyPopup(RichPopup conflictReadOnlyPopup) {
this.conflictReadOnlyPopup = ComponentReference.newUIComponentReference(conflictReadOnlyPopup);
}
public RichPopup getConflictReadOnlyPopup() {
RichPopup retVal = null;
if(conflictReadOnlyPopup != null)
retVal = (RichPopup) conflictReadOnlyPopup.getComponent();
return retVal;
}
Now to access any popup property you will have to usig the get method eg.
getConflictReadOnlyPopup().hide();
Af:Iterator Issue
The components inside af:iterator was not getting refreshed on ppr.
The reason was the page parent tag was . It started working after I removed the af:group tag
Subscribe to:
Posts (Atom)