6 Replies Latest reply on Feb 25, 2013 8:02 PM by 989825

    Contextual event on table not triggered

    Yannick Ongena
      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">
                <Item Value="DepartmentId"/>
                <Item Value="DepartmentName"/>
                <Item Value="ManagerId"/>
                <Item Value="LocationId"/>
              <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
                <event name="changeTheDept"
                       eventType="Currency Change Event"/>
      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");
      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"
            <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
              <event name="triggerEvent"
      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