3 Replies Latest reply on Jan 23, 2014 11:31 AM by chaluwa

    [SOLVED] Strange: Lifecycle Methods Are No Longer Called

    chaluwa

      Been working on an Errai app based on the errai-tutorial sample and have been making considerable progress, and boom ... @AfterInitialization method in the @EntryPoint class is no longer called ?

      I then decided to manually invoke the @AfterInitialization method from the @PostConstruct method but the result suggests that the @PostConstruct method too is not triggered. Has any one experienced this before ??

      This app has been running ...

        • 1. Re: Strange: Lifecycle Methods Are No Longer Called
          chaluwa

          I am still investigating, but it seems using a JsArray of JavaScriptObject items from within one of my @Templated @Page causes the main @EntryPoint not to fire @PostConstruct and @AfterInitialization. Once I comment-out the declaration of private JsArray<POI> places; and another method that accepts a custom JavaScriptObject, the @PostConstruct and @AfterInitialization methods gets triggered.

          • 2. Re: Strange: Lifecycle Methods Are No Longer Called
            chaluwa

            It turned out that there was a syntax error in the JSNI code of POI (JavaScripObject) class. Once it was fixed, everything worked fine again. However, I noticed similar behavior from other JavaScriptObject based classes like MarkerClusterer of GWT-Map (http://goo.gl/dLymaZ) and even GQuery (http://goo.gl/8oyw37). The Errai app fails to run just by doing $(id);

             

            Can someone pls investigate using GQuery and Errai ????

            • 3. Re: Strange: Lifecycle Methods Are No Longer Called
              chaluwa

              All the errors were either due to syntax errors in the JavaScriptObject JSNI code, not including the library in the .gwt.xml file or not including necessary JS files needed for them to work well. Once all of these were handled, the app started running fine again.