1 Reply Latest reply on Jan 10, 2013 10:48 PM by Erick Barreto

    Seam 2.3.0 + RichFaces 4.2.3 - <a:ajax> not being triggered

    Erick Barreto Newbie



      I'm creating this discussion because i havent found any problems similar to the one i'm facing. I've searched a lot and could not find a solution. So, my problem is: i have a form with many fields(most of them inputTexts + <s:decorate>), so i'm using <a:ajax event="blur" bypassUpdates="true"> to validate these fields when they lose focus. The problem is that i think the ajax is not being triggered or at least not completing the request. I've put the onbegin and oncomplete attributes in the tag, the first one is called but the second isn't along with the listener. I think i might be doing something wrong.  


      I'm using JSF 2.1.14 + RichFaces 4.2.3 + Seam 2.3.0


      I am putting here only a small part of the code.


      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                <ui:define name="header">
                          <meta lang="pt" http-equiv="Content-Type"
                                    content="text/html; charset=UTF-8" />
                <ui:define name="body">
                  <f:facet name="start">
                      <h:graphicImage value="/img/ai.gif" alt="ai" />
                          <h:form id="usuario" styleClass="edit">
                                              <rich:collapsiblePanel header="Info"
                                                        <s:decorate id="nomeField" template="layout/edit.xhtml">
                                                                  <ui:define name="label">Nome</ui:define>
                                                                  <h:outputLabel value="#{usuarioHome.instance.pessoa.nome}" />
                                                                  <h:inputText id="nome" size="10" maxlength="10"
                                                                            value="#{usuarioHome.instance.pessoa.nome}" required="true">
                                                                            <a4j:ajax event="blur" onbegin="alert('teste');" oncomplete="alert('test');" render="nomeField" bypassUpdates="true" listener="#{usuarioHome.test()}" />


      "UsuarioHome" is my EntityHome Class with Conversation scope. The "test" method has only a System.out. I also debugged the code and i see the method is not called.


      Thanks for your time,


        • 1. Re: Seam 2.3.0 + RichFaces 4.2.3 - <a:ajax> not being triggered
          Erick Barreto Newbie

          I was able to get it working, however i don't know the cause of the problem. In my message i didn't put the entire code, so there were some important things missing. There are 3 h:commandButtons and 2 s:buttons. When removing the 2 s:buttons from the <h:form>, the ajax request was completed. I have no idea why.


          Here's part of the code missing:


          <div class="actionButtons">

          <h:commandButton id="save" value="Save"

          action="#{usuarioHome.persist}" disabled="#{!usuarioHome.wired}"


          <s:conversationId />


          <h:commandButton id="update" value="Save"

          action="#{usuarioHome.update}" rendered="#{usuarioHome.managed}">

          <s:conversationId />


          <h:commandButton id="delete" value="Delete"

          action="#{usuarioHome.remove}" immediate="true"

          rendered="#{usuarioHome.managed}" />

          <s:button id="cancelEdit" value="Cancel" propagation="end"

          view="/Usuario.xhtml" rendered="#{usuarioHome.managed}" />

          <s:button id="cancelAdd" value="Cancel" propagation="end"

          view="/#{empty usuarioFrom ? 'UsuarioList' : usuarioFrom}.xhtml"

          rendered="#{!usuarioHome.managed}" />



          this was inside of the <h:form>. After removing both <s:buttons> from the form, it worked. Does anyone know why? Has anyone had any issues similar to mine? This is really weird.