Announcement

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

    12.1d js error in ListGrid.startEditingNew() if editor FormItem is canEdit=false

    Hi,

    A javascript error "Cannot read property 'undefined' of undefined" occurs while using method lg.startEditingNew(), if there is a FormItem defined as editorProperties and is set as canEdit=false. See the following example:

    Code:
    
    package pl.com.tech4.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.data.DataSourceField;
    import com.smartgwt.client.data.fields.DataSourceDateTimeField;
    import com.smartgwt.client.data.fields.DataSourceLinkField;
    import com.smartgwt.client.data.fields.DataSourceTextField;
    import com.smartgwt.client.types.FieldType;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.form.fields.LinkItem;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class MainEntryPoint implements EntryPoint {
    
        public void onModuleLoad() {
    
            layout();
            SC.showConsole();
        }
    
        private void layout() {
    
            DataSource projectDS = new DataSource();
    
            DataSourceField idField = new DataSourceField();
            idField.setType(FieldType.SEQUENCE);
            idField.setName("id");
            idField.setPrimaryKey(true);
            idField.setHidden(true);
            DataSourceTextField codeField = new DataSourceTextField();
            codeField.setName("code");
            DataSourceDateTimeField validFromField = new DataSourceDateTimeField();
            validFromField.setName("validFrom");
            DataSourceDateTimeField validToField = new DataSourceDateTimeField();
            validToField.setName("validTo");
            DataSourceLinkField infoField = new DataSourceLinkField();
            infoField.setName("info");
    
            projectDS.setFields(idField, codeField, validFromField, validToField, infoField);
    
            ListGridField linkLGF = new ListGridField("info");
            LinkItem linkItem = new LinkItem();
            linkItem.setCanEdit(false);
            linkLGF.setEditorProperties(linkItem);
    
            ListGrid lg = new ListGrid();
            lg.setAutoFetchData(false);
            lg.setCanEdit(true);
            lg.setDataSource(projectDS);
            lg.setUseAllDataSourceFields(true);
            lg.setFields(linkLGF);
    
            VLayout main = new VLayout();
            main.setHeight100();
            main.setWidth100();
            main.addMembers(lg);
            main.draw();
    
            lg.startEditingNew();
        }
    
    }
    Code:
    *10:59:27.577:WARN:Log:TypeError: Cannot read property 'undefined' of undefined
    Stack from error.stack:
        cons.getInactiveContext(<no args: exited>) on [LinkItem ID:isc_LinkItem_1 name:info] @ FormItem.js:5507:39
        cons._determineRowNum(<no args: exited>) on [DynamicForm ID:isc_DynamicForm_0] @ ListGrid.js:35197:40
        cons.hasFieldErrors(<no args: exited>) on [DynamicForm ID:isc_DynamicForm_0] @ ListGrid.js:35149:39
        cons.hasErrors(<no args: exited>) on [LinkItem ID:isc_LinkItem_1 name:info] @ FormItem.js:14651:49
        cons.getErrorWidth(<no args: exited>) on [LinkItem ID:isc_LinkItem_1 name:info] @ FormItem.js:4933:48
        cons._getErrorWidthAdjustment(<no args: exited>) on [LinkItem ID:isc_LinkItem_1 name:info] @ FormItem.js:4951:31
        cons.getTextBoxWidth(<no args: exited>) on [LinkItem ID:isc_LinkItem_1 name:info] @ FormItem.js:4916:34
        cons.getTextBoxCSS(<no args: exited>) on [LinkItem ID:isc_LinkItem_1 name:info] @ FormItem.js:7139:41
        cons.getReadOnlyHTML(<no args: exited>) on [LinkItem ID:isc_LinkItem_1 name:info] @ LinkItem.js:229:28
        cons._getTableHTML(<no args: exited>) on [LinkItem ID:isc_LinkItem_1 name:info] @ FormItem.js:6528:44
        cons.getInnerHTML(<no args: exited>) on [LinkItem ID:isc_LinkItem_1 name:info] @ FormItem.js:6082:30
        cons.getStandaloneItemHTML(<no args: exited>) on [LinkItem ID:isc_LinkItem_1 name:info] @ FormItem.js:5621:32
        cons.getEditItemCellValue(<no args: exited>) on [ListGrid ID:isc_ListGrid_0] @ ListGrid.js:25885:21
        cons.getCellValue(<no args: exited>) on [ListGrid ID:isc_ListGrid_0] @ ListGrid.js:24576:30
        cons.eval(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ [no file]:4:127
        cons._getCellValue(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ GridRenderer.js:4137:56
        cons.getTableHTML(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ GridRenderer.js:3353:48
        cons.getInnerHTML(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ GridRenderer.js:1041:26
        cons.invokeSuper(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ Class.js:1620:44
        cons.Super(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ Class.js:1438:21
        cons.getInnerHTML(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ ListGrid.js:925:21
        cons._getInnerHTML(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ Canvas.js:4773:21
        cons._updateInnerHTML(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ Canvas.js:7027:26
        cons.invokeSuper(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ Class.js:1628:40
        cons._updateInnerHTML(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ GridRenderer.js:1846:14
        cons._updateHTML(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ Canvas.js:6868:14
        cons.redraw(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ Canvas.js:6738:10
        cons.invokeSuper(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ Class.js:1628:40
        cons.redraw(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ GridRenderer.js:8411:10
        cons.invokeSuper(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ Class.js:1628:40
        cons.redraw(<no args: exited>) on [GridBody ID:isc_ListGrid_0_body] @ ListGrid.js:1983:14
        cons._showEditForm(<no args: exited>) on [ListGrid ID:isc_ListGrid_0] @ ListGrid.js:34433:22
        cons.showInlineEditor(<no args: exited>) on [ListGrid ID:isc_ListGrid_0] @ ListGrid.js:34275:10
        cons._startEditing(<no args: exited>) on [ListGrid ID:isc_ListGrid_0] @ ListGrid.js:33982:10
        cons.startEditing(<no args: exited>) on [ListGrid ID:isc_ListGrid_0] @ ListGrid.js:33595:14
        cons.startEditingNew(<no args: exited>) on [ListGrid ID:isc_ListGrid_0] @ ListGrid.js:36678:10
        pl_com_tech4_client_MainEntryPoint_$layout__Lpl_com_tech4_client_MainEntryPoint_2V(<no args: exited>) @ 8D1FBA824F99A70E2C2274B4AF7B24B7.cache.js:22156:116
        Array.com_google_gwt_lang_pl_100046com_100046tech4_100046index_1_1EntryMethodHolder_init__V(<no args: exited>) @ 8D1FBA824F99A70E2C2274B4AF7B24B7.cache.js:2875:3
        initializeModules(<no args: exited>) @ 8D1FBA824F99A70E2C2274B4AF7B24B7.cache.js:39:20
        com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(<no args: exited>) @ 8D1FBA824F99A70E2C2274B4AF7B24B7.cache.js:620:21
        com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(<no args: exited>) @ 8D1FBA824F99A70E2C2274B4AF7B24B7.cache.js:669:14
        <anonymous>(<no args: exited>) @ 8D1FBA824F99A70E2C2274B4AF7B24B7.cache.js:643:12
        com_google_gwt_lang_ModuleUtils_gwtOnLoad__Lcom_google_gwt_core_client_JavaScriptObject_2Lcom_google_gwt_core_client_JavaScriptObject_2Lcom_google_gwt_core_client_JavaScriptObject_2Lcom_google_gwt_core_client_JavaScriptObject_2V(<no args: exited>) @ 8D1FBA824F99A70E2C2274B4AF7B24B7.cache.js:52:30
        <anonymous>(<no args: exited>) @ 8D1FBA824F99A70E2C2274B4AF7B24B7.cache.js:22169:1
    SmartClient Version: SNAPSHOT_v12.1d_2019-03-16/LGPL Development Only (built 2019-03-16)

    Chromium
    65.0.3325.146 (Build) (64-bit)

    Thanks,
    MichalG

    #2
    Thanks for the notification. We've made a change which should address this issue
    Please try the next nightly build, dated March 23 or above

    Regards
    Isomorphic Software

    Comment


      #3
      Verified in v12.1d_2019-03-24/LGPL as fixed both in test case and application.
      Thanks,
      MichalG

      Comment

      Working...
      X