Results 1 to 2 of 2

Thread: Bug in combobox with remote and paging?

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2010
    Location
    Vancouver, Canada
    Posts
    258

    Default Bug in combobox with remote and paging?

    I was exploring a different issue and I came across the following bug. To reproduce please open this fiddle: https://fiddle.sencha.com/#view/editor&fiddle/31pe and:

    1. Type b in the combobox and click the magnifier.
    2. Navigate to the next page in the drop down list.

    In the console we have the following error:


    Code:
    ext-all-debug.js:2770 Uncaught Error: The model ID configured in data ("b") has been rejected by the int field converter for the id field
        at new Ext.Error (ext-all-debug.js:2770)
        at Function.raise (ext-all-debug.js:2835)
        at Object.Ext.raise (ext-all-debug.js:2916)
        at constructor (ext-all-debug.js:94089)
        at new App.model.Record (ext-all-debug.js:14562)
        at constructor.doSetValue (ext-all-debug.js:208126)
        at constructor.setValue (ext-all-debug.js:208001)
        at constructor.setValueOnData (ext-all-debug.js:207316)
        at constructor.onLoad (ext-all-debug.js:207308)
        at constructor.fire (ext-all-debug.js:22895)
    After debugging more I came across this code:

    Code:
                    if (!forceSelection) {
                        // We are allowing added values to create their own records.
                        // Only if the value is not empty.
                        if (!record && val) {
                            dataObj = {};
                            if (Ext.isObject(val)) {
                                dataObj[displayField] = val[displayField];
                                dataObj[valueField] = val[valueField];
                            } else {
                                dataObj[displayField] = val;
                                if (valueField && displayField !== valueField) {
                                    dataObj[valueField] = val;
                                }
                            }
                            record = new Model(dataObj);
                        }
                    }
                    // Else, if valueNotFoundText is defined, display it,
                    // otherwise display nothing for this value
                    else if (me.valueNotFoundRecord) {
                        record = me.valueNotFoundRecord;
                    }


    When forceSelection is false it seems that the combobox is trying to assign a value and it is assigning the text in the combobox to the id field which is actually int.

    Going up the stack trace, we have this code:

    Code:
        onLoad: function(store, records, success) {
            var me = this,
                // This flag is saying that we need to call setValue to match the value property
                // with the just loaded record set and update the valueCollection
                // (and thereby any bound ViewModel) with that matched record.
                needsValueUpdating = !me.valueCollection.byValue.get(me.value);
            // If not returning from a query, and the value was set from a raw data value,
            // unrelated to a record because the displayField was not honoured when calculating
            // the raw value, then we update the raw value.
            if (success && needsValueUpdating && !me.isPaging && !(store.lastOptions && 'rawQuery' in store.lastOptions)) {
                me.setValueOnData();
            }
            // This synchronizes the value based upon contents of the store
            me.checkValueOnChange();
            me.isPaging = false;
        },
    It seems that me.isPaging is false and me.setValueOnData was called.

    Could you please investigate this?

    Thanks

  2. #2
    Sencha User
    Join Date
    May 2010
    Location
    ?zmir
    Posts
    18

    Default

    +1

    looking for a solution or a workaround for this bug!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •