Get/Set PageFlowScope values

Following Get/Set Java methods can be used within a Managed Bean:

  • Get PageFlowScope value:
  public Object getPageFlowScopeValue(String name) {
    ADFContext adfCtx = ADFContext.getCurrent();
    Map pageFlowScope = adfCtx.getPageFlowScope();
    Object val = pageFlowScope.get(name); //Name = PageFlowScope value name

    if (val == null) { //Avoid null pointer exception
      return null;
    } else {
      return val;
    }
  }

  • Set PageFlowScope value:
  public Object getPageFlowScopeValue(String name) {
    ADFContext adfCtx = ADFContext.getCurrent();
    Map pageFlowScope = adfCtx.getPageFlowScope();
    Object val = pageFlowScope.get(name); //Name = PageFlowScope value name

    if (val == null) { //Avoid null pointer exception
      return null;
    } else {
      return val;
    }
  }





2 comments:

  1. Hey!

    Looks you had a copy-paste typo in the above post :)
    the setPageFlowScope also shows the code for getPageFlowScope. It should be something similar to this.

    ADFContext adfCtx = ADFContext.getCurrent();
    Map pageFlowScope = adfCtx.getPageFlowScope();
    pageFlowScope.put(name, value);

    ReplyDelete
  2. I think you are right.

    ReplyDelete