19 August, 2012

ADF Faces : Get Child Component

You can use the code snippet for finding child component under parent component  in ADF Faces.

   public static FacesContext getFacesContext() {  
     return FacesContext.getCurrentInstance();  
   public static UIComponent getChildUIComponent(String ParentUI, String ChildUI) {  
     UIComponent parentUI = getFacesContext().getViewRoot().findComponent(ParentUI);  
     UIComponent childUI = null;  
     UIComponent tempUI = null;  
     Iterator childrens = parentUI.getFacetsAndChildren();  
     while (childrens.hasNext()) {  
       tempUI = (UIComponent)childrens.next();  
       if (ChildUI.equals(tempUI.getId())) {  
         childUI = tempUI;  
     return childUI;  

Import the following Classes

 import javax.faces.component.UIComponent;  
 import javax.faces.context.FacesContext;  


OAF :Formatting DateTime Fields

Use the following code to format DateTime feilds in OAF OAWebBean departureDateBean = webBean.findChildRecursive("DepartureDate"...