4 Replies Latest reply on Nov 27, 2012 8:58 PM by 971290

    how to access payload  object in bean method

      I'm trying to access payload object in bean method like following but it gives the null or "" value.

      ELContext elctx = fctx.getELContext();
      ExpressionFactory expFactory = fctx.getApplication().getExpressionFactory();
      ValueExpression ve = expFactory.createValueExpression(elctx, "${payLoad.group}", String.class);//here group is attribute of payLoad object


        • 1. Re: how to access payload  object in bean method
          • 2. Re: how to access payload  object in bean method
            Frank Nimphius-Oracle

            the payLoad object cannot be accessed this way as it is not a memory object. Its been passed with the event and available to the event map.

            • 3. Re: how to access payload  object in bean method
              Hi Frank Thanks for reply though we were able to access payLoad object from with in bean method..Please check below code and let me know if that is not right way to access it..I would appriciate your reviw on it...

              //this get method as property called from handl condition of contextual event .if that returns true then only it propogates the event
              public boolean getShouldHandleEvent(){
              //boolean isHandle=false;
              //following line access payLoad object
              payLoadObject po=(payLoadObject)BindingContext.getCurrent().get(EventDispatcherImpl.PAYLOAD); //payLoadObject we pass as PayLoad from producer side

              String payloadFilter=po.getGroup().toString();
              String group=AdfFacesContext.getCurrentInstance().getPageFlowScope().get("group").toString();


              return isHandle;

              //page def of the consumer event

              <eventMap xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
              <event name="cityNameChange">
              <producer region="*">
              <consumer region="" handler="handleEventPayloadObject"
              <parameter name="customPayLoad" value="#{payLoad.city}"/>
              <parameter name="filter" value="#{payLoad.group}"/>

              Edited by: user732467 on Nov 15, 2012 7:21 AM
              • 4. Re: how to access payload  object in bean method
                Hi Frank,
                Sorry bother you again but its important for me to know if the way we access payload( in last response i have shown code) in to the bean is acceptable or not. I mean is there any drawbacks doing this ? I would appriciate if you can reply me your view on it.....Thanks