Flipkart Search

Sunday 25 November 2012

Static list in ADF the other way

The manage bean property of ADF can also provide the static list without a actual managed Bean{Interesting ??}. Let's do with an Example.
Inside your adfc-config.xml or your page-flow.xml register this list as below

  <managed-bean id="__3">
        <managed-bean-name>StaticBean</managed-bean-name>
        <managed-bean-class>java.util.HashMap</managed-bean-class>
        <managed-bean-scope>application</managed-bean-scope>
        <map-entries>
            <map-entry>
                <key>rahulkaitian</key>
                <value>http://rahulkaitian.blogspot.in</value>
            </map-entry>
            <map-entry>
                <key>rahulkumar07</key>
                <value>http://rahulkumar07.blogspot.in</value>
            </map-entry>
        </map-entries>
    </managed-bean>







and access the pair  in EL as #{StaticBean['rahulkaitian']}

Sunday 11 November 2012

Get and set task-flow input parameter value in managed bean

1. Method to get the value of TaskFlow inputParameter value 
public static Object getPageFlowParamVal(String tf_paramName){
  ADFContext adfContext = ADFContext.getCurrent();
  return adfContext.getPageFlowScope().get(tf_paramName);
  }
2.  Method to set the value of TaskFlow inputParameter value 
public static void putPageFlowVarVal(String pageFlowScopeVarName,
 Object pageFlowScopeVarVal) {
     ADFContext adfContext = ADFContext.getCurrent();
     adfContext.getPageFlowScope().put(pageFlowScopeVarName,pageFlowScopeVarVal);
  }