1 Reply Latest reply on Aug 16, 2008 8:23 AM by heakfall

    a4j:commandButton oncomplete tag

    heakfall

      hii, i have a problem with oncompletetag of a4j:commandButton. Well this is the code.

      <body onload="MM_preloadImages('imagenes/btn1.jpg', 'imagenes/btn2.jpg'); Richfaces.showModalPanel('panel',{width:350, top:110})">
       <f:view>
       <h:form>
       <rich:modalPanel id="panel" width="350" height="200">
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="Ingreso al sistema"></h:outputText>
       </h:panelGroup>
       </f:facet>
       <table border="0" width="300">
       <tr>
       <td>Usuario: </td>
       <td><h:inputText value="#{LoginListener._usuario}" styleClass="textbox" size="20" maxlength="20" /></td>
       </tr>
       <tr>
       <td>Password: </td>
       <td><h:inputSecret value="#{LoginListener._password}" styleClass="textbox" size="20" maxlength="20" /></td>
       </tr>
       <tr>
       <td>
       <a4j:commandButton value="Ingresar" action="#{LoginListener.Autenticar}" oncomplete="if (document.getElementById('hasMessages').value=='true') Richfaces.hideModalPanel('panel');" id="btnIngresar" styleClass="boton">
       </a4j:commandButton>
       </td>
       </tr>
       <tr>
       <td><h:outputText id="e12" value="#{LoginListener._autenticado}" /></td>
       </tr>
       </table>
      
       <h:inputHidden id="hasMessages" value="#{LoginListener._autenticado}" />
      
       </rich:modalPanel>
       </h:form>
       </f:view>
       <h1>FUNCIONA</h1>
       </body>
      
      


      Well, i have a page that show a modelpanel when load. The modelpanel is for login function. When i press "Ingresar" in the modalpanel, the function "Autenticar" in the backend bean is called and the result of he login process is save in "_autenticado". The problem is that when the login is succefull, the modalpanel has to hide. Im verifing the login results in the tag "oncomplete" of the button "Ingresar".

      Well, i hope u can help me with this. See u.