2 Replies Latest reply on Apr 10, 2008 11:16 AM by georgkuffer

    Ajax commandButton Action in a reRendered dataTable not call

    georgkuffer

      Hello,

      There`s a tree on the left in my site and a dataTable in the middle.
      It should work similar like Windows Explorer oder Linux Konqueror.

      On a click on a node in the tree, the list is updated with the new content. This ajax update works, beside the action of the commandButton, which is in the list. The action Method "test" in the dmsMainController Bean, which is in the rerendered dataTable, isn`t invoked.

      I'm using:
      richfaces 3.1.4GA
      JSF 1.2 Sun implementation

      Hier is my code.

      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      
      <html>
      <head>
       <title>Tree </title>
      </head>
      <body>
      <f:view >
      <h:form id="form1">
      <table>
      <tr>
       <td>
       <a4j:status id="commonstatus" startText="In progress..." stopText="Complete"/>
       </td>
      </tr>
      <tr>
       <td>
       <rich:toolBar height="34" itemSeparator="line">
       <rich:toolBarGroup>
       <h:graphicImage id="edit" value="/images/icons/edit.gif" />
       <a4j:commandButton value="Neuer Ordner" reRender="myTree" action="#{dmsMainController.newFolder}"></a4j:commandButton>
       </rich:toolBarGroup>
       </rich:toolBar>
      </td>
      </tr>
      <tr>
      <td valign="top" style="border:1px solid">
       <rich:tree id="myTree" style="width:300px;border:1px;" nodeSelectListener="#{dmsMainController.processSelection}"
       reRender="list" switchType="client" ajaxSubmitSelection="true"
       value="#{dmsMainController.treeNode}" var="item"
       icon="../../images/folder_closed.png" iconLeaf="../../images/folder_closed.png">
       </rich:tree>
      </td>
      <td>
       <rich:dataTable id="list" cellpadding="0" cellspacing="0" width="700" border="0" var="file" value="#{dmsMainController.files}" binding="#{dmsMainController.dataTable}">
       <rich:column>
       <f:facet name="header">Test</f:facet>
       <a4j:commandButton action="#{dmsMainController.test}" value="download"></a4j:commandButton>
       </rich:column>
       <rich:column id="name">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Name" /></f:facet>
       <h:outputText value="#{file.name}" />
       </rich:column>
       </rich:dataTable>
       </td>
      </tr>
      </table>
      </h:form>
      </f:view>
      </body>
      </html>
      


      Please anyone can help me!



        • 1. Re: Ajax commandButton Action in a reRendered dataTable not
          ilya_shaikovsky

          1) you did not specified reRender at button test
          2) If even method doesn't called - use phaseTracker please and check if JSF phases execution was ok.

          • 2. Re: Ajax commandButton Action in a reRendered dataTable not
            georgkuffer

            to 1) I tried "reRender="list", but it has no effect. I also see no sense in it due to the method "dmsMainController.test" on the download button is not called.

            to 2)
            the log of the phase Tracker is

            10.04.2008 17:01:15 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RESTORE_VIEW 1
            10.04.2008 17:01:15 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RESTORE_VIEW 1
            10.04.2008 17:01:15 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE APPLY_REQUEST_VALUES 2
            10.04.2008 17:01:20 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER APPLY_REQUEST_VALUES 2
            10.04.2008 17:01:20 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE PROCESS_VALIDATIONS 3
            10.04.2008 17:01:20 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER PROCESS_VALIDATIONS 3
            10.04.2008 17:01:20 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE UPDATE_MODEL_VALUES 4
            10.04.2008 17:01:20 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER UPDATE_MODEL_VALUES 4
            10.04.2008 17:01:20 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE INVOKE_APPLICATION 5
            10.04.2008 17:01:20 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER INVOKE_APPLICATION 5
            10.04.2008 17:01:20 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RENDER_RESPONSE 6
            10.04.2008 17:01:20 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RENDER_RESPONSE 6


            in my opinion this is allright.


            I test another thing. If I put a commandButton into the <f:facet> tag, it works. The method is invoked. But the commandButtons in rest of the dataTable do not call the method, which should be called.