3 Replies Latest reply on Apr 2, 2012 6:01 AM by healeyb

    since richfaces 4.2.0 a4j:ajax listener doesn't work

    typek_pb

      environment:

      WinXP, JDK 1.6.0_26, Jetty 6, richfaces 4.2.0Final

       

      problem desc:

      Since upgrade from richfaces 4.1 to 4.2.0 I'm not able to use a4j:ajax listener any more, since error is thrown on page opening in browser.

      For some reason content of listener is evaluated as bean's property rather than method.

       

      code:

      Following code throws error.

       

      relevant xhtml chunk:

                      <h:selectOneRadio value="#{mainView.role}" layout="pageDirection">

                          <a4j:ajax event="change" listener="#{mainView.roleChanged}"

                              render="schedulePanel okButton" />

                          <f:selectItems value="#{mainView.roles}" />

                      </h:selectOneRadio>

       

      relevant bean code:

      public void roleChanged(AjaxBehaviorEvent event) {

       

      error thrown:

      2012-04-01 09:02:44.750:WARN::/yourpresenter/main.jsf

      javax.el.ELException: /main.xhtml: The class 'com.google.code.yourpresenter.view.MainView' does not have the property 'roleChanged'.

          at com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:94)

          at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)

          at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)

          at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)

          at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)

      ...

       

      Should I fill a bug for this or is there a problem in my code?

      thanks

        • 1. Re: since richfaces 4.2.0 a4j:ajax listener doesn't work
          healeyb

          The code looks ok to me, I just tried this and it seems to work ok for me, although I'm running on a glassfish app

          server with 4.2.0.Final. The selectOneRadio isn't in a composite component by any chance? What browser are

          you using? What happens if you use f:ajax instead of a4j:ajax? Also ensure that the selectOneRadio is inside an

          <h:form></h:form>.

           

          Regards,

          Brendan.

          • 2. Re: since richfaces 4.2.0 a4j:ajax listener doesn't work
            typek_pb

            Hi Brendan,

             

            thanks a lot for reply. it was really helpful!

            What lead me to solution was your remark on glasfish.

             

            My deployment setup is either:

            - jetty - I'm using webby => no maven related checks

            - tomact - war built via maven

             

            When trying with tomcat I got error:

            [ERROR] error: error reading C:\Documents and Settings\pb\.m2\repository\org\richfaces\ui\richfaces-components-ui\4.2.0.Final\richfaces-components-ui-4.2.0.Final.jar; invalid LOC header (bad signature)

            => I had corrupted library downloaded via maven : richfaces-components-ui-4.2.0.Final.jar

             

            I checked sha and it was wrong. Redownload solved the problem.

             

            regards,

            Peter B.

            • 3. Re: since richfaces 4.2.0 a4j:ajax listener doesn't work
              healeyb

              I'm not sure I was much help but I'm pleased to see that your issue is resolved.