Announcement

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

    IPickTreeItem throws exception when calling setValue

    I’ve recently tried migrating our application from SmartGWT 4.1P -> 5.0 – specifically:

    SmartClient Version: v10.0p_2015-10-31/PowerEdition Deployment (built 2015-10-31)

    And have stumbled across an odd issue with the below testcase( modified from built-in-ds sample ) . The root of the issue seems to be a call to setValue() on a IPickTreeItem before the picktree has been drawn and the Developer Console is open.

    Code:
           
    
            TabSet tabSet = new TabSet();
            Tab tab1 = new Tab("tab1");
            Tab tab2 = new Tab("tab2");
    
            DynamicForm form = new DynamicForm();
            pickTree = new IPickTreeItem();
    
            Tree tree = new Tree();
    
            pickTree.setValueField("value");
            pickTree.setDisplayField("display");
            TreeNode[] nodes = new TreeNode[3];
            tree.setRootValue(-1);
            tree.setModelType(TreeModelType.PARENT);
            tree.setParentIdField("parent");
            tree.setIdField("id");
    
            for (int i = 0; i < 3; i++) {
                nodes[i] = new TreeNode();
                nodes[i].setAttribute("parent", -1);
                nodes[i].setAttribute("value", "test" + i);
                nodes[i].setAttribute("display", "TEST" + i);
                nodes[i].setAttribute("id", i);
            }
            tree.setData(nodes);
            pickTree.setValueTree(tree);
            form.setFields(pickTree);
            tab2.setPane(form);
            tabSet.setTabs(tab1, tab2);
            tabSet.selectTab(0);
    
            tabSet.setWidth100();
            tabSet.setHeight100();
            tabSet.draw();
    
            // pickTree.setValue("test2");
            IButton button = new IButton("press to set value");
            button.addClickHandler(new ClickHandler() {
    
                @Override
                public void onClick(ClickEvent event) {
                    pickTree.setValue("test2");        
    
                }
            });
            tab1.setPane(button);
    If I load the page and press the button in the first tab and the developer console is open - I get an exception:

    Code:
    10:47:52.605:MUP5:WARN:Log:Attempt to add properties to a null object. Creating a new object for the list of properties.
    10:47:52.643:MUP5:WARN:Log:com.google.gwt.core.client.JavaScriptException: (TypeError) 
     stack: isc_SelectionTreeMenu_getItemTitle@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Grids.js:3280
    isc.$75k.getTitle@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Grids.js:3281
    isc_c_Class_invokeSuper@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Core.js:282
    isc_c_Class_Super@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Core.js:274
    isc_c_PickTreeItem__getButtonTitle@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Forms.js:2357
    isc_StatefulCanvas_getTitleHTML@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Foundation.js:212
    isc_c_Class_invokeSuper@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Core.js:282
    isc_Button_getTitleHTML@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Foundation.js:481
    isc_StatefulCanvas_setTitle@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Foundation.js:213
    isc.$75k.setSelectedItem@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Grids.js:3283
    isc_PickTreeItem_saveValue@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Forms.js:2359
    isc_FormItem_setValue@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Forms.js:897
    $setValue@http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:13577
    dispatch@http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:13254
    $doFire@http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:637
    $fireEvent@http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:571
    $fireEvent_0@http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:2666
    fireEvent_0@http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:2675
    click_0<@http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:7313
    apply_0@http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:208
    entry0@http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:249
    @http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:234
    obj.click@http://127.0.0.1:8888/builtinds/59EB59E5A4190024282BCFB61D6F49C1.cache.html:7335
    isc_StatefulCanvas_handleActivate@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Foundation.js:231
    isc_StatefulCanvas_handleClick@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Foundation.js:232
    isc_c_EventHandler_bubbleEvent@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Core.js:1577
    isc_c_EventHandler_handleClick@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Core.js:1436
    isc_c_EventHandler__handleMouseUp@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Core.js:1421
    isc_c_EventHandler_handleMouseUp@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Core.js:1412
    isc_c_EventHandler_dispatch@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Core.js:1652
    anonymous@http://127.0.0.1:8888/builtinds/sc/modules/ISC_Core.js:77
    If the developer console is not open - I don't get the exception. I also don't see the exception if I first go to the 2nd tab, open the picktreeitem, and then press the button in the first tab.

    #2
    Just a follow up to let you know we see the problem (and the cause) but don't yet have a solution. We'll follow up when we do

    Regards
    Isomorphic Software

    Comment

    Working...
    X