This discussion is archived
6 Replies Latest reply: Feb 25, 2013 12:02 PM by 989825 RSS

Contextual event on table not triggered

Yannick Ongena Employee ACE
Currently Being Moderated
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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points