Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Exceptions due addChild() after upgrading 2.4 to 6.0

    HI guys,

    i migrated smartgwt from an old smartgwt lgpl 2.4 Version to 6.0-p20170116. GWT is in Version 2.8
    Now i have problems on application startup due Exceptions in addChild() or addMember() Calls.

    ....
    ConsoleLogger.java:50 (-:-) 2017-01-16 14:52:36,876 [FATAL] Uncaught Exception:
    ConsoleLogger.java:50 com.google.gwt.core.client.JavaScriptException: (ReferenceError) : getOrCreateRef_265_g$ is not defined
    ConsoleLogger.java:50 at Unknown.createCanvasGetOrCreateRefMethodMap_0_g$(cms-0.js@625:111757)
    ConsoleLogger.java:50 at Unknown.$clinit_ObjectFactory_0_g$(cms-0.js@43:111551)
    ConsoleLogger.java:50 at Unknown.createCanvas_2_g$(cms-0.js@3:111735)
    ConsoleLogger.java:50 at Unknown.getByJSObject_0_g$(cms-0.js@10:61419)
    ConsoleLogger.java:50 at Unknown.createCanvas_0_g$(cms-0.js@22:166303)
    ConsoleLogger.java:50 at Unknown.<anonymous>(cms-0.js@34:166546)
    ConsoleLogger.java:50 at Unknown.apply_0_g$(cms-0.js@28:9946)
    ConsoleLogger.java:50 at Unknown.entry0_0_g$(cms-0.js@16:10002)
    ConsoleLogger.java:50 at Unknown.createCanvas(cms-0.js@14:9982)
    ConsoleLogger.java:50 at Unknown.isc_c_Class_fireCallback()
    ConsoleLogger.java:50 at Unknown.isc_Class_fireCallback()
    ConsoleLogger.java:50 at Unknown.isc_CanvasItem__createCanvas()
    ConsoleLogger.java:50 at Unknown.isc_CanvasItem_init()
    ConsoleLogger.java:50 at Unknown.isc_Class_completeCreation()
    ConsoleLogger.java:50 at Unknown.isc_DynamicForm_createItem()
    ConsoleLogger.java:50 at Unknown.isc_DynamicForm__addItems)
    ConsoleLogger.java:50 at Unknown.isc_DynamicForm__setItems()
    ConsoleLogger.java:50 at Unknown.isc_DynamicForm_initWidget()
    ConsoleLogger.java:50 at Unknown.isc_Canvas_init()
    ConsoleLogger.java:50 at Unknown.isc_Class_completeCreation()
    ConsoleLogger.java:50 at Unknown.isc_c_Class_create()
    ConsoleLogger.java:50 at Unknown.create_165_g$(cms-0.js@48:153043)
    ConsoleLogger.java:50 at Unknown.getOrCreateJsObj_1_g$(cms-0.js@23:62001)
    ConsoleLogger.java:50 at Unknown.getOrCreateJsObj_3_g$(cms-0.js@61:152856)
    ConsoleLogger.java:50 at Unknown.addMember_2_g$(cms-0.js@37:71275)
    ConsoleLogger.java:50 at Unknown.addMember_0_g$(cms-0.js@10:71257)
    ......

    or an equivalent Exception in addChild() wenn i use something like:

    MyClass my = new MyClass();

    MyClass() {
    Window w = new Window();
    ListGrid listgrid = new ListGrid();
    w.addChild(listgrid);
    }

    In my previous Version everything worked fine, do i have to use addChild() / addMember() in a different Way in newer Versions?

    Thanks a lot for your hints.
    Last edited by MKunz; 16 Jan 2017, 07:23.

    #2
    Hi MKunz,

    the correct API is addItem(Canvas component), see the docs.

    Best regards
    Blama

    Comment


      #3
      Hi Blama ,

      thanks for your Response. addChild() isnt valid any more for this case? We use it in different parts of our application and with 2.4 successfully.

      Greetings,
      MKunz

      Comment


        #4
        Well, the class docs say
        Windows can contain arbitrary Smart GWT components, configured via the items property. Windows may be modal or non-modal.
        so my assumption is no, this is no longer (or perhaps: was never) correct.
        Also see the online window samples, which also use the API I mentioned.

        Best regards
        Blama

        Comment


          #5
          addChild() would not have done the right thing with a Window in any version of SmartGWT. It would add the ListGrid at the top left of the Window, occlusion get the header. addChild() makes sense elsewhere, for example when you use a Canvas as a container.

          Calling addChild() on a Window does not result in an exception however. That suggests corruption in your project. You may need to clear your browser cache, clear your GWT unitCache, restart your IDE, fix duplicates in your class path or take similar steps.

          Comment


            #6
            Hi Isomorphic,

            thanks a lot. gwt-unit Cache / other caches was the right hint. Now the application start.

            by the way:
            For our usecase, addChild() does the correct handling, also in the newest smartgwt version. We use it for an TextIItem with something like a suggestion Feature.

            Its something like (uncompiled code..) :

            public class SuggestionComponent extends CanvasItem {
            public SuggestionComponent() {
            VLayout layout = new VLayout();

            DynamicForm innerForm = new DynamicForm();
            innerForm.setWidth100();
            innerForm.setNumCols(1);
            innerForm.setColWidths("*");
            innerForm.setPadding(0);
            innerForm.setCellPadding(0);

            TextItem tagBox = new TextItem();
            tagBox.setShowTitle(false);
            innerForm.setFields(tagBox);

            layout.addMember(innerForm);

            MySuggestionListGrid suggestionListGrid = new MySuggestionListGrid();

            Window suggestionWindow = new Window();
            suggestionWindow.setShowHeader(false);
            suggestionWindow.setShowEdges(false);
            suggestionWindow.setDismissOnEscape(true);
            suggestionWindow.setCanDragReposition(false);
            suggestionWindow.setParentElement(this.getCanvas());

            suggestionWindow.addChild(suggestionListGrid);
            suggestionWindow.hide();
            }
            }

            So if the user start typing in the TextItem, we start a servercall to suggest Values to the user. An these suggestions pop up under the TextItem als a List..Works pretty good..

            I see that setParentElement is now deprecated, so we will take a close look to this part.. But it does what it does ;-)

            Thanks a lot again.

            Greetings

            Comment


              #7
              Hi,

              hm it still fails in SuperDevMode, but no problems with addChild() or setParentCanvas() in Prod Mode..
              Last edited by MKunz; 17 Jan 2017, 01:20.

              Comment


                #8
                As we covered, addChild() on a Window will place the added component on top of the Window header. In this case, since you've turned off all the features of Window and are basically using it as a blank container, that's actually what you want.

                We can't see a reason for a failure like this specific to SuperDevMode - some kind of caching or project corruption is still in place.

                Comment


                  #9
                  Thanks for your answer.

                  I will try to find out whats wrong.. Dependencies etc. looks ok.

                  We use the gwt maven plugin 2.8 to run a gwt:debug goal for super dev mode.
                  Are there known compatibility problems? Maybe we should try it with the described way for gwt 2.7+
                  http://www.smartclient.com/smartgwt/...eshooting.html

                  Thanks, best regards

                  Comment

                  Working...
                  X