3 Replies Latest reply: May 14, 2013 11:54 PM by Jeet_A RSS

    Publish Contextual Event on Tab Disclosure - jdev 11.1.2.3

    969955
      Hello:

      I need to publish a contextual event when a tab (ShowDetailItem) in PanelTabbed component is disclosed.

      In each Tab there is a bounded task flow dropped as a static region. Only open tabs are set to be "active".

      The published contextual event is consumed in the BTF dropped as a region in the ShowDetailItem of the tab.

      How can I declaritively or programatically publish the contextual event on disclose of the tab?

      Any sample code or article references would be greatly appreciated.

      Thanks.
        • 1. Re: Publish Contextual Event on Tab Disclosure - jdev 11.1.2.3
          Timo Hahn
          Check this thread {message:id=11014812}

          Timo
          • 2. Re: Publish Contextual Event on Tab Disclosure - jdev 11.1.2.3
            969955
            Thanks for the response...

            Let me add one other thing. The Bounded Task Flows are from an ADFLib. The examples I'm seeing look like this is not the case.

            In the ADF Developers Guide 11.1.2.3 page 34-13 shows how to create Contextual Events using Managed Bean. Which I think is what I want. In the java code there is the line:

            JUCtrlActionBinding actionBnd = (JUCtrlActionBinding)bc.getControlBinding("eventProducer");

            I'm not sure what to replace "eventProducer" with when the BTF is from an ADFLib.

            Any ideas?

            Thanks
            • 3. Re: Publish Contextual Event on Tab Disclosure - jdev 11.1.2.3
              Jeet_A
              Hi,

              eventProducer is the name of the Producer method.

              You need to a)create this method as Producer Method
              b)create DataControl
              c)Add it to jsff from where you want to raise event.

              You can check below blog.
              http://www.jobinesh.com/2009/07/programmatically-publishing-contextual.html

              You can download Workspace which explains
              1)Create Producer Method , EventProducer Data Control. Put Producer Method on task.jsff
              2)Create Consumer Method, Event Consumer Data Control.

              Then goto main.jspx where Event has been subscribed.
              Check in mainPageDef.xml --> ContextualEvents Event Publisher.
                <eventMap xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
                  <event name="MessagingEvent">
                    <producer region="mytaskflowdefinition1.taskPageDef.produceMessage">
                      <consumer region="" handler="consumeMessage">
                        <parameters>
                          <parameter name="msg" value="${payLoad}"/>
                        </parameters>
                      </consumer>
                    </producer>
                  </event>
                </eventMap>
              To raise event you can see Task.java
                      DCBindingContainer bc =
                          (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                      JUCtrlActionBinding actionBnd =
                          (JUCtrlActionBinding)bc.getControlBinding("produceMessage");
                      System.out.println("Producer : Programmatic Invokation !");
                      ((DCBindingContainer)bc).getEventDispatcher().queueEvent(actionBnd.getEventProducer(),
                                                                               "Hello, Did you call me?");
                      ((DCBindingContainer)bc).getEventDispatcher().processContextualEvents();
              Other Blog to refer
              http://one-size-doesnt-fit-all.blogspot.com/2010/08/jdev-11g-programmatic-contextual-events.html
              Programmatically publishing Contextual Events


              Thanks,
              Jit

              Edited by: appsjit on May 14, 2013 11:54 PM