How Do I Implement parameterMaps for ADF Regions and Dynamic Regions?
- by david.giammona
parameterMap objects defined by managed beans can help reduce the number of child <parameter> elements listed under an ADF region or dynamic region page definition task flow binding. But more importantly, the parameterMap approach also allows greater flexibility in determining what input parameters are passed to an ADF region or dynamic region. This can be especially helpful when using dynamic regions where each task flow utilized can provide an entirely different set of input parameters.
The parameterMap is specified within an ADF region or dynamic region page definition task flow binding as shown below:
<taskFlow id="checkoutflow1"
taskFlowId="/WEB-INF/checkout-flow.xml#checkout-flow"
activation="deferred"
xmlns="http://xmlns.oracle.com/adf/controller/binding"
parametersMap="#{pageFlowScope.userInfoBean.parameterMap}"/>
The parameter map object must implement the java.util.Map interface. The keys it specifies match the names of input parameters defined by the task flows utilized within the task flow binding. An example parameterMap object class is shown below:
import java.util.HashMap;
import java.util.Map;
public class UserInfoBean {
private Map<String, Object> parameterMap = new HashMap<String, Object>();
public Map getParameterMap() {
parameterMap.put("isLoggedIn", getSecurity().isAuthenticated());
parameterMap.put("principalName", getSecurity().getPrincipalName());
return parameterMap;
}