9 Replies Latest reply on Oct 4, 2013 3:25 AM by abaudry

    [RichFaces 4.3.2.Final] Converter (with a4j:ajax) intercepts a4j:commandLink (action is not fired)

    abaudry

      Hello,

       

      I have a project using RichFaces. I was using version 4.2.3.Final (with JSF 2.1.8) and had some screens with a step by step input:

      Step1:

      payement.jpg

      Step 2 (after clicking the button "Continue" wich is a a4j:commandLink):

      continue2.jpg

      As you can see, when clicking the button "Continue", the amount (wich is a h:inputText with a valueChangeListener and a 'a4j:ajax event="change" render="xxx" ') has been updated using a converter to display it properly and then the action linked to the a4j:commandLink is fired rendering the content below.

       

      I have made an update version of RichFaces. I am now using RichFaces 4.3.2.Final with JSF 2.1.19 and the behaviour of my a4j:commandLink has changed:

      Step 1:

      payement.jpg

      Step2  (after clicking the button "Continue" wich is a a4j:commandLink):

      continue1.jpg

      Step 3 (after clicking the button "Continue" once again):

      continue2.jpg

      The first click on the a4j:commandLink does not fire the action behind it, instead the change event is applied on the amount and user has to click again on the button to have it work. Is there anyway to have the same behaviour than before because it causes the user to click twice?

       

      Thanks for your answers.

       

      Regards,

      Alain

        • 1. Re: [RichFaces 4.3.2.Final] Converter (with a4j:ajax) intercepts a4j:commandLink (action is not fired)
          bleathem

          Can you provide the facelet source behind the above examples?  Your use case *should* continue to work.  eirther there is an error in the code, or a bug in either RichFaces or Mojarra (or are you using MyFaces?).

          • 2. Re: Re: [RichFaces 4.3.2.Final] Converter (with a4j:ajax) intercepts a4j:commandLink (action is not fired)
            abaudry

            Hello Brian

             

            here is the code, we use a lot of composite components:

             

            Amount:

            <rich:panel styleClass="#{cc.attrs.styleClass_panelEdition}"
                        id="montantEdition"
                        rendered="#{cc.attrs.mode_affichage eq actionCmpUtilsComposants.edition}">
                <h:outputText styleClass="operation-bloc-content-outputText-lib"
                              value="#{cc.actionCU.beanCmpContenu.contenuFichierCmp[cc.attrs.cle_libelle]}"
                              escape="false" rendered="#{cc.libelleVisible}"/>
                <h:outputText value="*"
                              styleClass="#{cc.attrs.styleClass_champs_obligatoire}"
                              rendered="#{cc.champObligatoire and cc.libelleVisible}"/>
                <rich:panel styleClass="#{cc.attrs.styleClass_edition}">
                    <rich:panel styleClass="chevron" rendered="#{cc.chevronVisible}"/>
                    <rich:panel styleClass="block left">
                        <rich:panel>
                            <h:inputText id="seuil" value="#{cc.attrs.source_montant}"
                                         disabled="#{cc.attrs.desactive}" size="#{cc.attrs.taille}"
                                         valueChangeListener="#{cc.attrs.montantEvent}"
                                         converterMessage="#{cc.actionCU.beanCmpContenu.contenuFichierCmp.Etape2_Bloc4_MessageErreur_Saisie}">
                                <f:converter converterId="montantConverter"/>
                                <f:attribute name="convTruncate" value="#{cc.attrs.arrondi}"/>
                                <f:attribute name="messageConverteur"
                                             value="#{cc.actionCU.beanCmpContenu.contenuFichierCmp.MessageErreur_Saisie}"/>
                                <a4j:ajax event="change" render="#{cc.attrs.zoneRender}"/>
                            </h:inputText>
            
            
                            <h:outputText value="&amp;nbsp;" escape="false"
                                          styleClass="block left"/>
                            <h:outputText styleClass="#{cc.attrs.styleClass_symboleEdition}"
                                          value="#{cc.actionCU.beanCmpContenu.contenuFichierCmp.Euro}"
                                          rendered="#{cc.deviseVisible}"/>
                        </rich:panel>
                        <rich:panel>
                            <h:message for="seuil" showSummary="true" showDetail="false" style="color:red"/>
                        </rich:panel>
                    </rich:panel>
            
            
                </rich:panel>
            </rich:panel>
            

             

             

            Continue Button:

            <a4j:commandLink
                    styleClass="operation-navigation-primary-btn-poursuivre"
                    actionListener="#{cc.attrs.poursuivre}" render="#{cc.attrs.zoneRenderPoursuivre}"
                    rendered="#{not cc.attrs.desactiverPoursuivre}"
                    >
              <span> <span> <span title="#{cc.actionCU.beanCmpContenu.contenuFichierCmp.Bt_Poursuivre}">
              #{cc.actionCU.beanCmpContenu.contenuFichierCmp.Bt_Poursuivre} </span> </span> </span>
            </a4j:commandLink>
            

             

             

            Action fired by the Continue button:

            public void afficherSuiteMontantAInvestir(final ActionEvent event) {
                if (!event.getPhaseId().equals(PhaseId.INVOKE_APPLICATION)) {
                    event.setPhaseId(PhaseId.INVOKE_APPLICATION);
                    event.queue();
                } else if (!"0".equals(beanMontantInvesti.getMontantTotalInvestir().trim())
                        && !beanMontantInvesti.getMontantTotalInvestir().isEmpty()) {
            
                    beanMontantInvesti.setMontantInvestiSaisie(false);
                    beanTypeVersement.setAfficherTypeVersementCommandLink(false);
                    beanMontantInvesti.setDesactiverMontantAInvestir(true);
                    beanMontantInvesti.setDesactiverContinuerMontantAInvestir(true);
            
                    beanRepartitionVersement.setAfficherRepartitionVersement(true);
                    beanRepartitionVersement.setAfficherRepartitionVersementCommandLink(true);
               } else {
                    beanMontantInvesti.setMontantInvestiSaisie(true);
                }
            }
            

             

            We are using Mojarra.

            Do you need any more information?

             

            Regards,

            Alain

            • 3. Re: Re: [RichFaces 4.3.2.Final] Converter (with a4j:ajax) intercepts a4j:commandLink (action is not fired)
              bleathem

              To recap: You are using RichFaces 4.2.3.Final & Mojarra 2.1.8 and are moving to RichFaces 4.3.2.Final & Mojarra 2.1.19

               

              Your code looks fine, nothing sticks out to me as being unconventional, although it's hard to be sure seeing only a small piece of it.

               

              Are any errors reported?

              1. Check the console log of your Browser
              2. Check your server log

               

              Try using a4j:log to gain some insight into the network communication.  Post the results of a4j:log here for help with the analysis.

              (For detailed instructions on collecting this log information see: https://gist.github.com/lfryc/6123495)

               

              You can also try upgrading just one jar at a time.  Use RichFaces 4.3.2.Final with Mojarra 2.1.8 and/or RichFaces 4.2.3.Final with Mojarra 2.1.19.  This would help narrow down whether the problem lies in RichFaces or in Mojarra.

              • 4. Re: Re: [RichFaces 4.3.2.Final] Converter (with a4j:ajax) intercepts a4j:commandLink (action is not fired)
                abaudry

                Hello Brian,

                 

                your recap is correct. I have no error in my browser or server console. I'll use a4j:log and set my PROJECT_STAGE to Development to get more information.

                 

                One more thing is that I am also using PortletBridge 3.2.1.Final.

                 

                I'll try to change one jar at a time and see what happens.

                • 5. Re: Re: [RichFaces 4.3.2.Final] Converter (with a4j:ajax) intercepts a4j:commandLink (action is not fired)
                  abaudry

                  Hello,

                   

                  I have made some tests and it appears that this behaviour is due to RichFaces.

                   

                  Regards,

                  Alain

                  • 6. Re: [RichFaces 4.3.2.Final] Converter (with a4j:ajax) intercepts a4j:commandLink (action is not fired)
                    bleathem

                    Thanks for the investigations.  Can you file a jira issue including an SSCCE example we can use to reproduce the issue locally?

                    https://community.jboss.org/wiki/SubmittingEffectiveIssueReports

                    • 7. Re: [RichFaces 4.3.2.Final] Converter (with a4j:ajax) intercepts a4j:commandLink (action is not fired)
                      abaudry

                      Hello Brian,

                       

                      I'll try to do it as soon as possible. I have also encountered issues with IE8 and IE7. It looks like the packed.js crashes with those browsers (it works well with FF and Chrome), have you got any idea that could help?

                       

                      Here is a snapshot of the error I get when click on a4j:commandLink

                      RF432-JSError.jpg

                       

                      Thanks a lot,

                      regards,

                      Alain

                      • 8. Re: [RichFaces 4.3.2.Final] Converter (with a4j:ajax) intercepts a4j:commandLink (action is not fired)
                        bleathem

                        On re-reading the issue I just noticed that you mentioned you use portlets.  Do these errors you are describing only manifest themselves in the portlet environment?  If you put the same code in a "vanilla JSF + RichFaces" application does it work correctly?  Knowing this will be important in narrowing down the source of the problem.

                        • 9. Re: [RichFaces 4.3.2.Final] Converter (with a4j:ajax) intercepts a4j:commandLink (action is not fired)
                          abaudry

                          Maybe, I'll try to run some tests, using my servlets alone. I have contact with Ken Finningan team leader for JBoss PortletBridge for other subjects.

                           

                          I'll keep you informed.

                           

                          Regards,

                          Alain