Contextual event consumption

Hello,
I am using JDeveloper 11.1.1.7.0.
So.. I have a page that contains a region. The region has a contextual event that is activated when the selected item from a drop down list is changed.
I am consuming the event (in the page) in a java class (that is implemented as a data control).
My question is, how can i change the value of a value from my page and also refresh (partialTrigger) the item? (my page has a bean class)
Thank you.

Hi,
check this
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/regionpayloadcallbackpattern-1865094.pdf
Frank

Similar Messages

  • Calling a method on backing bean in response to contextual event

    Hi
    I am using Jdeveloper 11.1.1.6.0 and using ADF contextual events..
    I have a drop down list and i am rasiing a contextual event on changing the current selection. In response to that event i want to call a backing bean method with parameters.. But when i click on the subscriber section for the contextual event, i can see only some bindings of the page.. How can i call a method on backing bean as a subscriber..
    Thanks
    Raghu

    Hi,
    this article has a use case for the POJO approach: http://www.oracle.com/technetwork/issue-archive/2011/11-may/o31adf-352561.html
    Another is to define a method binding in the receiving PageDef file and configure it as explained here
    http://java.net/projects/smuenchadf/pages/ADFSamplesBindings/revisions/3#SMU164
    Frank

  • Triggering Validation in a Region Through a Contextual Event

    I am using JDeveloper 11.1.1.6.0.
    I am trying to find out how to trigger the built in validation that occurs normally when a "submit" action occurs, but have the submit action occur outside of a region, and the validation also occur in the region itself.
    I have a page that contains a dynamic region in it. I will refer to the containing page as the parent and the region as the child. The parent region and child region both have different business objects bound to them, though they are part of the same application module. The parent page contains a submit button that needs commit the user entered data in both the parent and child pages. This action must not proceed if there are any validation errors in the parent or the child. The validation should trigger on the parent page without any work from me because of how ADF handles the situation. The child page is notified of the submit action via contextual events. I currently have it where this event can trigger the "commit" action successfully, but I have no idea how to go about ensuring that it triggers a validation check as well.
    The overall flow that I think will happen in the final version is likely:
    1: submit button pressed.
    2: parent page validation is checked (if success, proceed)
    3: contextual event is fired
    4: contextual event is received by the child.
    5: the child triggers its own validation (if success, proceed, else stop)
    6: the child triggers a commit action
    7: the child sends a response contextual event (signalling that it was successful)
    8: the parent receives the response contextual event
    9: the parent performs a "commit" action.
    I do not know how to cause step 5 to occur, and I do not know if steps 7 through 9 are needed yet (I haven't tested to see if causing the commit in either the parent or the child ends up causing all modified entity objects to be committed). Any help would be greatly appreciated.
    Thank you

    Hi,
    you can access a command button on the page fragment and queue its action event. For this you access a managed bean (backingBean Scope) that contains a handler to the command button and queue the event (this then will perform validation as if the user clicked it. The command button can also be hidden on the fragment.
    Have a look here for how you can integrate the managed bean as the contextual event handler
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/regionpayloadcallbackpattern-1865094.pdf
    Frank

  • Dynamic TaskFlow Gets Refreshed on Catching a Contextual Event

    Hi,
    I am using Contextual events in my application. I have 2 task flows in my parent page. One TF is raising an event and the other is catching it. As my catching TF is a dynamic TF, I have specified the event map in it only.
    Everything is working as intended only that my dynamic TF gets refreshed when it catches the event! I do not want that. I want to explicitly refresh any UI component that requires to be refreshed, not the whole TF.
    So is there any specific property of task flows that make it to refresh itself when ever it catches any contextual event?
    Also I have tried 'Refresh="ifNeeded"' and 'RefreshCondition="#{false}"' in my dynamic taskflow specification in the parent page but it does not make any difference.
    Regards,
    Rahul Saxena

    Rahul,
    there is no setting for this. If however the managed bean you setup for handling the dynamic region is in backing bean scope (or request scope) then chances are that the region is refreshed because the bean restes after the request (just assuming here). Yournot giving us much to chew on (no JDeveloper version, no implementation details etc. ) So its hard to provide further ideas. As a last resort, if you have a support contract, you can contact customer support with a test case
    Frank

  • Task Flow Exit Using contextual Events ??

    I am using Jdeveloper 11.1.1.5.
    My application has a page which has two regions in it.
    First region has a bounded task flow with just one fragment in it(Just with a button)
    and Second region has a BTF which has five fragments in it(which is a kind of train process).
    On clicking the button in the first region I want to exit and reenter the bounded Taskflow in the second region.I am trying to do this using contextual events but the exit and reentry doesn’t happen as expected.
    For example - if the user is in the third fragment of the second region and clicks the button in the first region, then the task flow should exit and the control should go to the first fragment in the second region.
    In the consumer method I am returning the “action” string which will call the “TaskFlow Return call” activity but the “TaskFlow return call is not being called.
    Could some one help me resolve this issue.
    Thanks in advance.
    - Pani

    I am using Jdeveloper 11.1.1.5.
    My application has a page which has two regions in it.
    First region has a bounded task flow with just one fragment in it(Just with a button)
    and Second region has a BTF which has five fragments in it(which is a kind of train process).
    On clicking the button in the first region I want to exit and reenter the bounded Taskflow in the second region.I am trying to do this using contextual events but the exit and reentry doesn’t happen as expected.
    For example - if the user is in the third fragment of the second region and clicks the button in the first region, then the task flow should exit and the control should go to the first fragment in the second region.
    In the consumer method I am returning the “action” string which will call the “TaskFlow Return call” activity but the “TaskFlow return call is not being called.
    Could some one help me resolve this issue.
    Thanks in advance.
    - Pani

  • Communication through contextual events in ADF 11g?

    hi everyone ,
    I have a requirement that i have to establish a communication between two taskflows and communication between page and the two taskflows at a time through contextual events
    I'm able to establish a communication between two taskflow regions but when it comes to establish a communication between a page and two taskflows at a time the two taskflows are rendering but the region in page s not
    (when i click deptno in taskflow region ,the employee table is displayed according to the deptno in another taskflow and the region contains output text is not at all rendering according to the deptno)
    plz do this needful
    thanx in advance

    Hi,
    contextual events are between active PageDef files. This means that if a task flows is not displayed on a view, then it is not included in contextual event communication.
    Frank

  • Contextual Event on row selection in the table

    Hi,
    My taskflow has just a view activity which queries a view object and displays results as a table. This taskflow is inserted in the main page as a region. I have set up a selection listener on the table, to map to a method in a managed bean. I have made this method binding a producer of my contextual event. and another method binding on the main page as a consumer. I have mapped producer and the consumer on a event map on the main page.
    My problem is when a row is selected in the table, I see the method (in the selection listener) is called but the event is not fired and the consumer method is not called. I don't know, if it is because the producer method (selection listener) takes SelectionEvent as a parameter?.
    I added just to test, a button on my view activity and mapped the action listener to another method(with out parameters) on the same managed bean and made this a producer. In this situation the event got fired and the consumer method got called.
    Why is the selection listener method not firing the event?
    Thanks in advance.

    Hi,
    the two events that are supported for ADF Faces component events are ActionEvent and ValueChangeEvent. So if you have a selection event, you need to take this infromation and create an ActionEvent from it.
    http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/event/ActionEvent.html
    Frank

  • Contextual event in reverse direction ( from child TF to parent view )

    Hi ,
    It seems all example of Contextual events talk about mirroring input value from Parent page to Child TF running in a region and there are numerous examples out there.
    What I wanted to accomplish was that an lov in a child TF triggers a contextual event and the parent TF takes the selected list of values. It needs to conduct a search based on these values and than mark the rows in a (tree)table.
    What has succeeded is almost all aspects of this. I can fire the event and receive it successfully. But the problem is the the backingBean class that I create via EL is not binded to my parent pages components. The treetable component returns null.
    My handler code (the handler code from the bean which you use to create the data control to listen to the cntxtual event) is almost 1:1 to as the code from the book "Oracle Fusion Developer Guide: Building Rich Internet Applications with Oracle ADF Business Components and Oracle ADF Faces", Chapter 6, page 210.
    public void receiveEvent(
    DCBindingContainerValueChangeEvent incomingPayload){
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    Application app = fctx.getApplication();
    ExpressionFactory exprFactory = app.getExpressionFactory();
    ValueExpression valExpr = exprFactory.createValueExpression(
    elctx,
    //reference the managed bean that holds the mirror value
    //property displayed in the input text field
    "#{backingBeanScope.ConsumerBackingBean}",
    Object.class);
    ConsumerBackingBean consumer = null;
    consumer = (ConsumerBackingBean)valExpr.getValue(elctx);
    //get the changed attribute value from the contextual event
    //payload
    String newValue = (String)incomingPayload.getNewValue();
    //set the new value to the backing bean property that is
    //referenced by the input text field in View 3
    consumer.setMirrorValue(newValue);
    AdfFacesContext adffacesContext = null;
    adffacesContext = AdfFacesContext.getCurrentInstance();
    //partially update the text field to display the new value
    adffacesContext.addPartialTarget(consumer.getMirrorTxt());
    The #{backingBeanScope.ConsumerBackingBean} evaluates in my case to fine. But every component I should see as binding in the bean is null.
    Since the handler is declared in the pageDef of this parent page Fragment, i assumed the last bit about it being able to get to the backing bean and hence to my components should also be possible.
    If I cant refresh my components than I dont see the use of the contextual frameworks for me.

    You should find this post useful: http://flexponential.com/2010/12/05/saving-scroll-position-between-views-in-a-mobile-flex- application/
    It demonstrates one way of saving and restoring data when pushing and popping a view.

  • Need a Small & Simple example to demo Contextual Event Framework

    Hi,
    As I'm tired of trying to understand Contextual Event Framework from Dev Guide & various sites in NET.
    So finally came here to find an answer from a good developer.
    My goal is to know Contextual Event Framework, with a very simple (or Simplest) example possible.
    Scenario# I have a Producer.jsff page that has an InputTextBox.
    I want to give an input into this Box say "Welcome To CEF" & using CEF I want to Display this value in consumer.jsff page.
    Both producer.jsff & consumer.jsff are in one CEFDemoTF.xml
    And this TaskFlow is in CEFDemoPage.jspx.
    Now I want to know where should I create Event Map.. and Publish & consume event to display the text "Welcome To CEF" in consumer.jsff page.
    Thanks in Advance.

    Oracle Magazine had an article about this: http://www.oracle.com/technetwork/issue-archive/2011/11-may/o31adf-352561.html
    Timo

  • Contextual Event for a Button in Dialogue (inline popup)

    I have dialogue(in-line popup window) which opens on click of button "viewPopUp" in parent window.
    I have a table and "select" button inside dialogue. I have contextual event created for this button inside child wondow.
    It never works for me. Its not calling the event handler method. But, If I add a contextual event for the button "viewPopUp" on the parent page works fine.
    Anybody faced similar issue?
    Any idea or tips to get it work?
    Edited by: sideeque on Sep 17, 2011 11:08 PM
    Edited by: sideeque on Sep 17, 2011 11:09 PM

    I use JDeveloper 11.1.1.5. I might be doing something wrong here. Do you have the sample code to share and test in JDeveloper 11.1.1.5? Is it running for you in JDeveloper 11.1.1.5 version?

  • Contextual event on table not triggered

    Using Jdev PS4.
    Concider following example: http://www.yonaweb.be/ContextualEvent.zip
    (I know following example can be simplified by using master-detail relation in the data control but it's to illustrate the example)
    I have two taskflows: EmployeeTF and departmentTf.
    The idea is to trigger an event when I select a new record in the department table.
    This is the tree binding:
    <tree IterBinding="DepartmentsIterator" id="Departments">
          <nodeDefinition DefName="model.views.DepartmentsView" Name="Departments0">
            <AttrNames>
              <Item Value="DepartmentId"/>
              <Item Value="DepartmentName"/>
              <Item Value="ManagerId"/>
              <Item Value="LocationId"/>
            </AttrNames>
            <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
              <event name="changeTheDept"
                     customPayLoad="${bindings.DepartmentId.inputValue}"
                     eventType="Currency Change Event"/>
            </events>
          </nodeDefinition>
        </tree> I have created a custom java class to use as a data control to find out when the event is triggered. This is my code:
        public void handleEvent(Object payload){
            System.out.println("Event handler");
            System.out.println(payload);
        }When I select a record in the table, the event does not get fired.
    So as a test I added my own custom method to see if contextual events are working properly so I added this method to my DC:
        public void triggerEvent(){
            System.out.println("triggering event");
        }and added it on a commandLink to the DepartmentTF. I also added an event on it:
    <methodAction id="triggerEvent" RequiresUpdateModel="true"
                      Action="invokeMethod" MethodName="triggerEvent"
                      IsViewObjectMethod="false" DataControl="EmpBean"
                      InstanceName="EmpBean.dataProvider">
          <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
            <event name="triggerEvent"
                   customPayLoad="#{bindings.DepartmentId.inputValue}"/>
          </events>
        </methodAction>When I trigger this event, my event handler does get called on the employee taskflow.
    So, my question is:
    1) Is this normal behavior that the change row event is not triggered?
    2) if yes, how do I trigger it or what is the purpose of this event?
    Edited by: Yannick Ongena on May 28, 2012 9:03 PM

    I have a similar circumstance: I have a page with two regions, each region contains a table. The two tables share some information so when I update one of them
    I also want the change to be reflected in the other table. I tried to use contextual events to send an event that causes one of the tables to refresh (I do not pass any payload)
    but so far I have not had any success with making this work. I am wondering if the bug you mentioned here would also prevent such a setup to work? I am using Jdev 11g R1 11.1.1.6.2.

  • Contextual Event Automatically refreshing child regions

    Hello,
    Here's my dilemma. We have an ADF page fragment that contains three regions(which point to 3 different bounded task flows). Lets call the bounded taskflows btf1, btf2, and btf3.
    What currently happens is we use contextual events to create communication between (btf1 and btf2) and communication between (btf2 and btf3)? We do not have contextual event that would allow communication between btf1 and btf3.
    So we currently have this communication working. Hence, when I hit a button in btf1, it fires off a contextual event, such that btf2 is refreshed. But what is happening here, is that btf3 is also being refreshed. We DON'T want THIS... We only want btf3 to be refreshed from an event that is fired from btf2.
    Question. Is there a way to restrict ADF from refreshing btf3 everytime and event is fired from btf1.
    In general, it seems as though all regions are being refreshed everytime a contextual event is fired. We don't want this. How can disable this from happening? We have checked all of wiring. There is no connection between btf1 and btf3.

    Try creating the event mapping - please see "28.7.2 How to Create Contextual Events Manually" in Dev Guide http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/web_adv.htm#CACJBFGI

  • Contextual event closes the af:popup from which it is generated ?!?

    Hi all
    I have task flow (isloated mode) embedded as region in af:popup.
    One from my popup's button action generates contextual event.
    But that event unexpectedly closes my popup.
    Any idea why ?
    Here is relevant pageDef settings.
    From page fragment where is event generated :
        <action id="Commit" InstanceName="EmpAppModuleDataControl"
                DataControl="EmpAppModuleDataControl" RequiresUpdateModel="true"
                Action="commitTransaction">
          <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
            <event name="empCommit"
                   customPayLoad="${bindings.VOIterator.currentRow.key}"/>
          </events>
        </action>From page fragment pageDef's where is consumer registered :
      <eventMap xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
        <event name="empCommit">
          <producer region="createeditemptf1.create_edit_emp_dataPageDef.Commit">
            <consumer handler="receiveEmpCommit">
              <parameters>
                <parameter value="${payLoad}" name="incPayLoad"/>
              </parameters>
            </consumer>
          </producer>
        </event>
      </eventMap>Notice "receiveEmpCommit consumer.
    This is a parent task flow backing bean method, registered as method action in the same pageDef, according to the Steve Muench example
    ".Method Action Invoking Managed Bean Method Without Making Bean a DataControl"
    https://blogs.oracle.com/smuenchadf/resource/examples
    And here is:
         <methodAction DataControl="EmpAppModuleDataControl"
                    id="receiveEmpCommit"               
                    InstanceName="${searchEmpBacking}"
                    MethodName="receiveEmpCommit">
          <NamedData NDName="incPayLoad" NDType="oracle.jbo.Key"/>
        </methodAction>So, what is wrong with this settings, any idea ?!?
    Edited by: Cvele_new_account on Apr 23, 2012 5:57 AM

    Thanks for response.
    Yes, it is (af:commandToolbarButton with default partialSubmit="true")
    Actually, everything works as exceptted, until "receiveEmpCommit" consumer is registered in the pageDef.
    And to be worse, that method does nothing, he is empty.
    Dimitar Dimitrov wrote:
    The button should be configured to do a partial submit (i.e. partialSubmit="true"), otherwise it will close the popup because the inline popups are not re-rendered when a full submit is made. Please check if your button is configured for a partial submit.
    Dimitar

  • Contextual event - Question

    Hi ,
    I have the following scenario :
    There is a region A which raises a contextual event. There is a page (say Test.jsff) containing region A and region B both of which can be invoked as popups . Region B also contains Region A.
    Both Test.jsff and Region B subscribe to the contextual event raised by Region A. The requirement is that Test.jsff should subscribe to the contextual event when it is raised directly from Region A but ignore when the event is raised from the Region A within Region B.
    The only way I could think of achieving the above is by adding an EL expression in the handleCondition of the handler method in subscriber's page def (Test.jsff in this case). This was the information I found in dev guide for conditional subscription. Is this approach correct?
    Are there any other ways to go about it for e.g:
    i)such as event be consumed by the direct parent only ?
    ii)Do you think raising two different events one for Test.jsff and another for Region B is a good idea?
    Would really appreciate help from experts on the above queries.

    Any updates?.
    Appreciate your inputs on the above.
    Thanks!

  • Contextual Event - "Currency Change Event" not raised?

    Hey,
    I am trying to raise contextual event on a table when I click on a row. The event type for a table is eventType="Currency Change Event" But is not working.
    Here is the event in the PageDef file.
    <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
    <event name="paramValueChangedEvent"
    customPayLoad="${bindings.PolicyId.inputValue}"
    eventType="Currency Change Event"/>
    </events>
    After that I want to raise custom method:
    <methodAction id="testEvent" InstanceName="myBean.dataProvider"
    DataControl="myBean" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="testEvent"
    IsViewObjectMethod="false"/>
    Here is the event map:
    <eventMap xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
    <event name="paramValueChangedEvent">
    <producer region="*">
    <consumer region="" handler="testEvent" handleCondition=""/>
    </producer>
    </event>
    </eventMap>
    When I raise the event programmatically, then the event is raised and my function is called.
    Here is the code. I call this function on a custom selection listener of the table.
    public void riseCurrencyChangeEvent(String treeID, String nodeID,
    String attributeValuedPassedName) {
    DCBindingContainer bc = ADFFacesUtils.getDCBindingContainer();
    FacesCtrlHierBinding tbl =
    (FacesCtrlHierBinding)bc.findCtrlBinding(treeID);
    FacesCtrlHierNodeBinding node =
    (FacesCtrlHierNodeBinding)bc.findCtrlBinding(nodeID);
    EventDispatcher dispatcher = bc.getEventDispatcher();
    node = (FacesCtrlHierNodeBinding)tbl.getRootNodeBinding();
    dispatcher.queueEvent(node.getEventProducer(),
    node.getCurrentRow().getAttribute(attributeValuedPassedName));
    bc.getEventDispatcher().processContextualEvents();
    My idea is not to call custom method after clicking on a table row, but I want to raise declaratively the event because I will need so generics.

    Hi,
    there is a bug 10045872 filed for this. The bug is scheduled for fixing in PS4 (11.1.1.5) I'll work on a manual - though code centric - alternative for the time being and publish it on ADF Code Corner when done.
    Frank

Maybe you are looking for