Ajax commandButton Action in a reRendered dataTable not call
georgkuffer Apr 8, 2008 9:24 AMHello,
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!