Using latest SC 9.1..
When I call listGrid.setFieldProperties(fieldNum, properties) to set valueMap to a field, it goes on to set header button with the same properties as {valueMap: {...}} as in
ISC_CORE.js : setProperties() would then try to find a setter (for valueMap) as in
Unfortunately, headerButton in this case has a special setValueMap(field, map) defined in ISC_CORE.js:
This is not meant to be treated as a normal setter method and it takes TWO parameters. Consequently it adds "valueMap:undefined" to the original valueMap and has thus corrupted it.
The symptom is not obvious on the surface until this valueMap is later processed to iterate for key:value pairs, but none the less this is a case of potential leak and corruption. I've attached a screenshot of stack trace to aid investigation.
When I call listGrid.setFieldProperties(fieldNum, properties) to set valueMap to a field, it goes on to set header button with the same properties as {valueMap: {...}} as in
Code:
ISC_GRIDS.js:setFieldProperties: if (this.header != null && this.header.isDrawn()) { // getFieldHeader / getLocalFieldNum will account for frozen fields var header = this.getFieldHeader(fieldNum), headerButton = header.getMember(this.getLocalFieldNum(fieldNum)); if (headerButton) headerButton.setProperties(properties); }
Code:
if (setter) { this[setter](value); if (this.propertyChanged) this.propertyChanged(propertyName, value); }
Code:
//> @method dataBoundComponent.setValueMap() // Set the valueMap for a field // // @param fieldID (number) number of field to update // @param map (object) ValueMap for the field // //< setValueMap : function (field, map) { if (!isc.isAn.Object(field)) field = this.getField(field); if (!field) return; field.valueMap = map; },
The symptom is not obvious on the surface until this valueMap is later processed to iterate for key:value pairs, but none the less this is a case of potential leak and corruption. I've attached a screenshot of stack trace to aid investigation.
Comment