6 Replies Latest reply on Oct 16, 2008 9:37 AM by bitsal

    Problem with a4j:jsFunction data=

    bitsal

      When I use a4j:jsFunction:

      <a4j:form>
       <a4j:jsFunction name="getWork" ajaxSingle="true"
       data="#{serializableBean.work}"
       oncomplete="alert('cool!')" />
      </a4j:form>
      
      <script ...>
      
       getWork();
      
      </script>
      



      class Work implements Serializable {
       private int id;
       private int fromHour;
       private int countHours;
       private String state;
      
       public int getId() {
       return id;
       }
      
       public void setId(int id) {
       this.id = id;
       }
      
       public int getFromHour() {
       return fromHour;
       }
      
       public void setFromHour(int fromHour) {
       this.fromHour = fromHour;
       }
      
       public int getCountHours() {
       return countHours;
       }
      
       public void setCountHours(int countHours) {
       this.countHours = countHours;
       }
      
       public String getState() {
       return state;
       }
      
       public void setState(String state) {
       this.state = state;
       }
      }
      


      Error:
      javax.servlet.ServletException: Property 'countHours' has no getter method at javax.faces.webapp.FacesServlet.service(FacesS...

      Please, help to understand this problem and give me same decision of this problem.

        • 1. Re: Problem with a4j:jsFunction data=

          Code is correct.
          Most likely, you have a problem with different classloaders. I.e. the problem is not on the application, but on the container level.

          • 2. Re: Problem with a4j:jsFunction data=
            dab.snooper

            Could you please provide more info about "Most likely, you have a problem with different classloaders. I.e. the problem is not on the application, but on the container level."

            Thanks!

            • 3. Re: Problem with a4j:jsFunction data=
              ilya_shaikovsky

              describe your environment application server, libraries used in your application with versions..

              • 4. Re: Problem with a4j:jsFunction data=
                bitsal

                Application server - Glassfish v9.1_02 (build b04-fcs)

                Libraries:

                jsf-api: 1.2_09
                jsf-impl: 1.2_09
                richfaces-api: 3.2.1GA
                richfaces-impl: 3.2.1GA
                richfaces-ui: 3.2.1GA
                xmlParserAPIs-2.6.2.jar
                antlr-2.7.6.jar
                xmlParserAPIs-2.6.2.jar
                xercesImpl-2.6.2.jar
                spring-2.5.3.jar
                servlet-api-2.3.jar
                poi-2.5.1-final-20040804.jar
                persistence-api-1.0.jar
                logkit-1.0.1.jar
                log4j-1.2.12.jar
                junit-addons-1.4.jar
                ta-1.0.1B.jar
                jboss-common-core-2.0.4.GA.jar
                jboss-archive-browsing-5.0.0alpha-200607201-119.jar
                javassist-3.3.ga.jar
                hibernate-validator-3.0.0.ga.jar
                hibernate-entitymanager-3.3.1.ga.jar
                hibernate-commons-annotations-3.0.0.ga.jar
                hibernate-annotations-3.3.0.ga.jar
                hibernate-3.2.6.ga.jar
                ehcache-1.2.3.jar
                dom4j-1.6.1.jar
                dbunit-2.2.jar
                concurrent-1.3.4.jar
                commons-logging-1.1.jar
                commons-lang-2.3.jar
                commons-collections-3.2.jar
                clover-2.3.2.jar
                cglib-2.1_3.jar
                avalon-framework-4.1.3.jar
                asm-attrs-1.5.3.jar
                asm-1.5.3.jar
                antlr-2.7.6.jar

                • 5. Re: Problem with a4j:jsFunction data=
                  ilya_shaikovsky

                  B.t.w. after looking through your code again we've found next thing you need to change.

                  replace

                  class Work implements Serializable {

                  with
                  public class Work implements Serializable {




                  • 6. Re: Problem with a4j:jsFunction data=
                    bitsal

                    Thank you very mush!!!!!!!!!

                    It helps me!:)