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;  


1 comment:

How to Pass Parameters to ActionListener in ADF

In some cases, it is required to pass a value to ActionListener of ADF Button. The method that can be invoked by actionListeners has only...