Announcement

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

    getValueFieldName throws error

    Hello,

    I'm a bit confused as to where the error lies (upgrade of our SmartGWT libs, or maybe just my own development), but I'm suddenly getting this error:

    Code:
    (TypeError): Cannot read property 'dataSource' of null stack: TypeError: 
    Cannot read property 'dataSource' of null at Object.isc_FormItem_getValueFieldName [as getValueFieldName] ISC_Forms.js:1166:122
    at Object.getValueFieldName [as getValueFieldName_0]
    Has this function in FormItem.js changed recently?
    Code:
    getValueFieldName : function () {
    	if (this.valueField) return this.valueField;
    	
    	if (this.form.dataSource && this.foreignKey) 
    		return isc.DS.getForeignFieldName(this, this.form.dataSource);
    Maybe it couldn't hurt to check if(this.form) exists as well?



    I don't see anything in hosted mode, only in compiled mode, Chrome & IE8.
    SmartGWT LGPL 2.4 build Feb 3, 2011

    #2
    No changes here recently. This looks like some kind of a lifecycle error, probably a usage issue, where a FormItem is being used after the form has been destroyed. A single null check is unlikely to fix the problem because you'll run into other nulls later if you don't correct the lifecycle problem.

    Let us know if you can isolate the change further.

    Comment

    Working...
    X