8 Replies Latest reply on Aug 14, 2012 10:39 AM by Brendan Healey

    jsFunction data executing backing bean function twice

    garagoth Newbie

      m I misusing Hello everyone,

       

      I am having a strange problem with a4j:jsFUnction.

      My setup is as following:

      GlassFish Server Open Source Edition 3.1.2.2 (build 5)

      RichFaces 4.2.2.Final (tried with 4.3.0 M1 as well)

       

      I have a simple jsf2 page with <a4j:jsFunction name="fetchDataFromBean" data="#{sessionBean.fetchData()}" oncomplete="do_some_stuff_with_data(event.data);"/>

       

      fetchData() is simple:

      public Object[] fetchData() { /* process... and return Object[] */ }

       

      Then every time I call myFunction() from javascript (or any onsomething event), there is ONE request to serwer (checked that with firebug), method fetchData() in my backing bean gets called TWICE (I am logging this in server log), second one immediately after first one finishes executing, and results of SECOND method execution are returned back to browser (to event.data).

       

      Am I misusing jsFunction or is this a bug in RF?

      How can I make it work as expected?

       

      Regards,

      Marcin.