Announcement

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

    RestDataSource with nested DataSource field produces endless loop

    The issue is present at least in stock smartgwt-3.1 and the latest nightly build of that version.
    It is caused by DataSource.js in the method validateJSONRecord:

    There are two nested for loops using the same index:

    Code:
    validateJSONRecord : function (record) {
            var fieldNames = this.getFieldNames(),
                result = {};
            for (var i = 0; i < fieldNames.length; i++) {
                (...)
                    if (fieldDS && !(fieldDS.skipJSONValidation)) {
                        if (!(isc.isAn.Array(fieldValue))) {
                            fieldValue = fieldDS.validateJSONRecord(fieldValue);    
                        } else {
                            for (var i = 0; i < fieldValue.length; i++) {
                                fieldValue[i] = fieldDS.validateJSONRecord(fieldValue[i]);
                            }
                        }                    
                    }
                 (...)
    Changing the inner loop index from i to j solves the issue.

    #2
    Thanks for the report - this has been addressed in 8.3p/3.1p and 9.0d/4.0d - please retry with a nightly build of January 11 or later

    Comment

    Working...
    X