Assume that we have the following task flow:
and we need to show the navigation options available from the present view activity in a choice list, as shown below:
How can we do his?
First,we should bind the af:Region to a RichRegion attribut from our managed bean and use the Capabilities API available in ADF to populate the choice list as shown below:
Further hits:
The EL expression enabling to use the capabilities is shown as below:
You can download this sample from the link below:
TFRegionCapabilities.rar (369 ko)
First,we should bind the af:Region to a RichRegion attribut from our managed bean and use the Capabilities API available in ADF to populate the choice list as shown below:
public SelectItem[] getSelectItems(){Then we populate our af:SelectOneChoice component with the SelectItems attribut from the managed bean as shown below:
RegionModel rm = getRegion().getRegionModel();
Set<String> capabilities = rm.getCapabilities();
SelectItem[] selectItems = new SelectItem[capabilities.size()];
Object[] capabilitiesArray = capabilities.toArray();
String option;
for ( int i = 0; i < capabilitiesArray.length; i++ ){
option = capabilitiesArray[i].toString();
selectItems[i] = new SelectItem(option);
}
return selectItems;
}
<af:selectOneChoice label="Navigations Available" id="soc1" autoSubmit="true"We can also navigate inside the region when the value of af:SelectOneChoice changes using the method explained in our previous article.
valueChangeListener="#{navigationBean.navigate}" >
<f:selectItems value="#{navigationBean.selectItems}" id="si1"/>
</af:selectOneChoice>
Further hits:
The EL expression enabling to use the capabilities is shown as below:
#{bindings.testTF1.regionModel.capabilities['home']}The EL expression above figures out if the region has home as an available navigation capability from the current view activity or not.
You can download this sample from the link below:
TFRegionCapabilities.rar (369 ko)

