Problem with a4j:commandButton
bwilliam Feb 10, 2009 6:44 PMHi,
I have a problem with a4j:commandButton not executing it's action when placed after a data table see source below:
<table cellpadding="0" cellspacing="0" width="100%"> <tr> <td class="body-main-wide" style="height: 630px;"> <h2>Agronomists Portal</h2> <h:form> <%-- THIS COMMAND BUTTON WORKS CORRECTLY: generalBean.takeIrrigatorSelection is executed --%> <a4j:commandButton value="Select Party" action="#{generalBean.takeIrrigatorSelection}" onclick="Richfaces.hideModalPanel('IrrigatorSelectMp')" oncomplete="javascript:Richfaces.showModalPanel('IrrigatorPropertyMp');"/> </h:form> <h:form> <%-- Modal panel for irrigator selection --%> <rich:modalPanel id="IrrigatorSelectMp" showWhenRendered="true" height="395"> <f:facet name="header"> <h:outputText value="Select Irrigator" /> </f:facet> <f:facet name="controls"> <h:commandLink value="Close" style="cursor:pointer" onclick="Richfaces.hideModalPanel('IrrigatorSelectMp')" /> </f:facet> <t:outputText>Please select an irrigator to use from the list below.</t:outputText> <h:form> <rich:scrollableDataTable id="irrDataTable" var="irrigator" value="#{generalBean.agronomistParties}" rendered="true" sortMode="single" height="305px" binding="#{generalBean.irrigatorDataTable}" selection="#{generalBean.selectedIrrigator}"> <rich:column width="18"> <h:graphicImage value="#{initParam.imagesDir}/user1-16.png" /> </rich:column> <rich:column width="100"> <f:facet name="header"> <h:outputText value="Please select an irrigator." /> </f:facet> <h:outputText value="#{irrigator.formalPartyName}" /> </rich:column> </rich:scrollableDataTable> </h:form> <h:form> <%-- THIS COMMAND BUTTON DOES NOT WORK CORRECTLY: generalBean.takeIrrigatorSelection is NOT executed --%> <a4j:commandButton value="Select Party" action="#{generalBean.takeIrrigatorSelection}" onclick="Richfaces.hideModalPanel('IrrigatorSelectMp')" oncomplete="javascript:Richfaces.showModalPanel('IrrigatorPropertyMp');"/> </h:form> </rich:modalPanel>
Can anybody tell me what is wrong here? I'm using RichFaces3.3.0 with myfaces 1.2.6 on Tomcat6. Thanks heaps for any feedback.
Brett