Forum Stats

  • 3,827,736 Users
  • 2,260,814 Discussions


ADF table ContextualEvent not working

CesarH Member Posts: 5 Red Ribbon


I created a sample ADF project with a page and a data control.

The page has a table with 3 rows, when I run the project in Integrated Weblogic and click on a row (any row) for the first time nothing happens. When I click the second time, and following, the ContextualEvent is triggered.

Can you help me?



  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,462 Red Diamond

    User, tell us your exact JDev version, please!

    Which context event are you talking about?

    Have you defined one?

    Show us some of the page UI code and java code if you have done anything in java.


  • CesarH
    CesarH Member Posts: 5 Red Ribbon


    I'm using the Jdev version

    Page UI

    <?xml version='1.0' encoding='UTF-8'?>

    <jsp:root xmlns:jsp="" version="2.1" xmlns:af="">

      <af:panelGroupLayout id="pgl0" layout="vertical">

       <af:table value="#{bindings.list.collectionModel}" 







            fetchSize="#{bindings.list.rangeSize}" id="t1">

        <af:column headerText="#{bindings.list.hints.first.label}" id="c1">

         <af:outputText value="#{row.bindings.first.inputValue}" id="ot1"/>


        <af:column headerText="#{bindings.list.hints.second.label}" id="c2">

         <af:outputText value="#{row.bindings.second.inputValue}" id="ot2"/>



      <af:spacer id="s1" height="20px"/>

      <af:separator id="s2"/>

      <af:spacer id="s3" height="20px"/>

      <af:outputLabel value="Selected Row:" id="ol1"/>

      <af:panelFormLayout id="pfl1">

       <af:inputText value="#{bindings.first.inputValue}" 




       <af:inputText value="#{bindings.second.inputValue}" 







    Contextual event configuration

    <tree IterBinding="listIterator" id="list">

       <nodeDefinition DefName="view.Pojo" Name="list0">


         <Item Value="first"/>

         <Item Value="second"/>


            <events xmlns="">

         <event name="ShowDetail" customPayLoad="#{bindings.listIterator.currentRow.dataProvider}"

             eventType="Currency Change Event"/>





    <eventMap xmlns="">

      <event name="ShowDetail">

       <producer region="list0">

        <consumer region="" handler="loadDetail">


          <parameter name="customPayload" value="#{payLoad}"/>



        <consumer region="" handler="Execute"/>




    Data Control

    public class DataControlClass {

      private List<Pojo> list = null;

      private Pojo payload;

      public DataControlClass() {


        list = new ArrayList<Pojo>();

        Pojo obj = new Pojo();





      obj = new Pojo();





        obj = new Pojo();





      public void setList(List<Pojo> list) {

        this.list = list;


      public List<Pojo> getList() {

        return list;


      public void setPayload(Pojo payload) {

        this.payload = payload;


      public Pojo getPayload() {

        return payload;


      public void loadDetail(Pojo payload) {

        System.out.println("Consumer event!");

        this.payload = payload;




    Request bean


      public void selectionListener(SelectionEvent selectionEvent) {

        // Add event code here...


        System.out.println("selection event!");

        invokeMethodExpression("#{bindings.list.collectionModel.makeCurrent}", Object.class, SelectionEvent.class, selectionEvent);



      public Object invokeMethodExpression(String expr, Class returnType,

                            Class argType,

                            Object argument) {

        FacesContext fc = FacesContext.getCurrentInstance();

        ELContext elctx = fc.getELContext();

        ExpressionFactory elFactory =


        MethodExpression methodExpr =

          elFactory.createMethodExpression(elctx, expr, returnType,

                           new Class[] { argType });

        return methodExpr.invoke(elctx, new Object[] { argument });



    Please, see attached application.


  • CesarH
    CesarH Member Posts: 5 Red Ribbon
    edited May 11, 2022 3:47PM


    The error ocurrs only for the first time I select the first row of the list.

    If I click other row than the first the contextual event is fired.

    However, in any case, the selectionListener event is always fired.

  • dvohra21
    dvohra21 Member Posts: 14,579 Gold Crown

    Are the first and second clicks in quick succession?

  • CesarH
    CesarH Member Posts: 5 Red Ribbon

    Only first click on first row.

    Second and following runs ok.

  • dvohra21
    dvohra21 Member Posts: 14,579 Gold Crown

    May be the first row is already selected by default. Is it? If so, clicking on it may not be generating the contextual event.

  • CesarH
    CesarH Member Posts: 5 Red Ribbon
    edited May 12, 2022 2:58PM

    The table selectionListener is always fired, that means there is no row selected (on first click).

  • dvohra21
    dvohra21 Member Posts: 14,579 Gold Crown

    Doesn't seem like contextual events are used properly.

    Two regions are needed, a producer, and a consumer region. As example, one region contains the first-task-flow task flow which utilizes the first.jsff page fragment. The second region contains the second-task-flow task flow which utilizes the second.jsff page fragment.

    The main page index.jsff includes both regions.

    The sample application in has only one page fragment.