Getting an iterator and passing through it

Here you have some code for getting the iterator by name go through the values.

DCIteratorBinding iter = findIterator(“YOUR_ITERATOR_NAME”);

Row[] rows = iter.getAllRowsInRange();
for (Row row : rows) { // do something here }

* Find an iterator binding in the current binding container by name.
* @param name iterator binding name
* @return iterator binding
public static DCIteratorBinding findIterator(String name) {
DCIteratorBinding iter = getDCBindingContainer().findIteratorBinding(name);
if (iter == null) {
throw new RuntimeException(“Iterator ‘” + name + “‘ not found”);
return iter;

* Return the current page’s binding container.
* @return the current page’s binding container
private static BindingContainer getBindingContainer() {
BindingContext bc = BindingContext.getCurrent();
return bc.getCurrentBindingsEntry();

* Return the Binding Container as a DCBindingContainer.
* @return current binding container as a DCBindingContainer
public static DCBindingContainer getDCBindingContainer() {
return (DCBindingContainer)getBindingContainer();


Clean the value of invisible items

Here is a code that you can use to clean the values of some elements if you have a structure of questions that are showing/hiding based on selection.

The approach is to have a main component that contains the tree of questions. The component id will be provided.

There is one issue regarding the inheritance of visible parameters in ADF 11, looks like if you have a panelGroupLayout that is visible=false, the components inside are not having visible=false. (No comment on that).

Hope you find it useful. The cleaning of the value is just for some of the components, check the clean method.
public static void cleanInvisibleItems(String componentId) {
UIComponent component = findComponentInRoot(componentId);
if (component != null) {
List<UIComponent> list = component.getChildren();

public static UIComponent findComponentInRoot(String id) {
UIComponent component = null;

FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext != null) {
UIComponent root = facesContext.getViewRoot();
component = findComponent(root, id);
return component;

// find a UIComponent inside a UIComponent
public static UIComponent findComponent(UIComponent base, String id) {
if (id.equals(base.getId()))
return base;

UIComponent children = null;
UIComponent result = null;
Iterator childrens = base.getFacetsAndChildren();
while (childrens.hasNext() && (result == null)) {
children = (UIComponent);
if (id.equals(children.getId())) {
result = children;
result = findComponent(children, id);
if (result != null) {
return result;

private static void parseTree(List<UIComponent> list) {

List<UIComponent> levelChildren = new ArrayList<UIComponent>();
for (UIComponent elem : list) {
boolean toClean = false;
if (elem instanceof RichPanelGroupLayout) {
RichPanelGroupLayout comp0 = (RichPanelGroupLayout)elem;
if (!comp0.isVisible()) {
toClean = true;
if (!toClean) {
List<UIComponent> children = elem.getChildren();
addTolistChildren(levelChildren, children);



private static void addTolistChildren(List<UIComponent> levelChildren, List<UIComponent> children) {
for (UIComponent child : children) {

private static void clean(UIComponent elem) {
List<UIComponent> children = elem.getChildren();
for (UIComponent child : children) {
if (child instanceof RichSelectOneRadio) {
RichSelectOneRadio comp = (RichSelectOneRadio)child;
} else if (child instanceof RichSelectManyCheckbox) {
RichSelectManyCheckbox comp = (RichSelectManyCheckbox)child;
} else if (child instanceof RichSelectBooleanCheckbox) {
RichSelectBooleanCheckbox comp = (RichSelectBooleanCheckbox)child;
} else if (child instanceof RichSelectManyListbox) {
RichSelectManyListbox comp = (RichSelectManyListbox)child;

Passing a parameter from EL ADF

Passing a parameter from EL (expression language) so that you can handle the current value considering that you have a table and for each row you have to enable or disable a button based on the parameter provided.

-Code in the fragment.

<af:column sortable=”false” headerText=”Actions” id=”c5″>
<af:commandButton text=”ADD” id=”cb3″
disabled=”#{pageFlowScope.taskDetailsBean.showBtn[row.Id] eq ‘false’}”/>

-Code in managed bean

public Map getShowBtn() {
return new HashMap<Long, String>() {
public String get(Object key) {
Number id = (Number)key;
if (processSelected.contains(id))
return “false”;
return “true”;

This is only for ADF 11, currently in 12c it’s much simple,