3 Replies Latest reply on Oct 9, 2013 2:26 PM by Brian Leathem

    a4j:ajax with rowclick event inside rich:dataTable isn't working

    Hauke Gulich Newbie

      {Hello everyone,

       

      -- Richfaces 4 --

       

      I have a simple rich:datatable and what a listener that will be noticed when I click on a row inside my table.

       

      What I did so far

       

       

      {code:xml}

      <rich:dataTable value="#{control.lightList}" var="licht" width="100%" id="lichtListe" columns="5" columnClasses="lightTableWidthNarrow,lightTableWidthLarge,lightTableWidthLarge,lightTableWidthNarrow,lightTableWidthLarge">

                  <a4j:ajax event="rowclick" listener="#{control.selectActiveLight}"/>

      {code}

       

      and my bean looks like this

       

       

       

      {code}

      public void selectActiveLight(AjaxBehaviorEvent evt) {

         logger.info("---------------------- clicked on a row ");

         UIExtendedDataTable dataTable = (UIExtendedDataTable) evt.getComponent();

         logger.info("---------------------- clicked on a row " + dataTable.getId());

      }

      {code}

       

      but nothing happens if I click on a row.

       

      The strange thing is, if I change the a4j:ajax line to

       

       

      {code:xml}

      <a4j:ajax event="rowclick" listener="#{control.selectActiveLight}" render="lichtListe"/>

      {code}

       

      I can see in my log files, that the lichtListe (the datatable) will be reloaded. So I guess the a4j:ajax event is correct, but why isn't my listener called at all.

       

      Thanks a lot,

      Hauke