4 Replies Latest reply on Apr 22, 2008 11:48 PM by Sergio Del Valle

    Error evaluate oncomplete function undefined

    Sergio Del Valle Newbie

      Hi all, I'm trying to show validation messages in a modal panel, so I followed the tip about adding an outputpanel with a hidden input holding the value of facesContext.maximumSeverity.ordinal, in order to check if there was an error in the request.

      Then I added a couple of js functions to the page

      <script type="text/javascript">
       function ajaxRequestContainsErrors() {
       return document.getElementById("maximumSeverity").value == "2";
       }
      
       function showPanelIfErrors(panel) {
       if (ajaxRequestContainsErrors())
       Richfaces.showModalPanel(panel);
       }
      </script>
      


      And finally I use these functions in the submit button of my form

      <h:form id="editForm">
       <h:panelGrid binding="#{mainPanel.editionGrid}" border="0"
       cellpadding="4" cellspacing="0"
       columnClasses="col1,col2" columns="4"
       styleClass="editGrid"/>
       <rich:tabPanel id="details" binding="#{mainPanel.detailsTabs}"/>
       <a4j:commandButton id="saveButton"
       actionListener="#{mainPanel.processAction}"
       oncomplete="showPanelIfErrors('errorsPanel')"
       reRender="mainTabPanel"/>
       <rich:modalPanel id="errorsPanel" autosized="true"
       resizeable="false" zindex="3000">
       <f:facet name="header">
       Errores
       </f:facet>
       <f:facet name="controls">
       <h:graphicImage value="images/close.png" style="cursor: pointer"
       onclick="Richfaces.hideModalPanel('errorsPanel')"/>
       </f:facet>
       <rich:messages/>
       </rich:modalPanel>
       </h:form>
      


      The validation is working fine, the messages are being populated according to it, the maximumSeverity input value is being updated fine, the problem is the modal panel is not showing, if I look at the a4j log window it shows the error:

      error[15:19:57,578]: Error evaluate oncomplete function undefined

      What am I doing wrong? I saw there is a bug reported in jira, but it is supposed to be solved since Richfaces 3.1.x. I'm using GlassfishV2UR1, JSF 1.2 (Mojarra 1.2_08-b06-FCS), Facelets 1.1.13, Richfaces 3.2.0.SR1

      Thanks in advance.

      Sergio Del Valle