Announcement

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

    Has the observation sequence and data set order changed?

    1. SmartClient Version: v9.1p_2014-07-23/Pro Deployment (built 2014-07-23)
    2. IE 9, 10, 11 - Chrome 36.0.1985.125 m - Firefox 30.0

    I have a very simple page with a 'SelectItem' and a 'ComboBoxItem'. Both are connected to datasources.
    The 'SelectItem' has the 'defaultToFirstOption' set to true. The 'ComboBoxItem' observes the 'SelectItem' via the 'dataArrived' event.
    The 'ComboBoxItem' filters its values according to the current value of the 'SelectItem'.
    the current value of the 'SelectItem' is obtained by calling the "getSelectedRecord()" method of the 'SelectItem' widget.

    This used to work fine in previous versions of PRO SmartClient but as from version
    v9.1p_2014-07-23/Pro Deployment (built 2014-07-23), the "getSelectedRecord()" returns null.

    This leads me to think that a bug may be present or that the observation sequence has changed.

    BEFORE:
    1. Server sends data to 'SelectItem'.
    2. 'SelectItem' sets its value to the first option if 'defaultToFirstOption' is set to true.
    3. 'dataArrived' event is fired
    4. Widgets listening to 'dataArrived' event access the first option of 'SelectItem' using "getSelectedRecord()" method.
    Data IS present. Application works.

    AFTER:
    1. Server sends data to 'SelectItem'.
    2. 'dataArrived' event is fired
    3. Widgets listening to 'dataArrived' event access the first option of 'SelectItem' using "getSelectedRecord()" method
    Data IS NOT present. Application at this point is convulsing with the null/undefined etc Javascript error.
    4. 'SelectItem' sets its value to the first option if 'defaultToFirstOption' is set to true.

    Can you confirm that this new behaviour is a bug (that will be fixed in a future nightly) or that the observation sequence order has effectively changed?

    NOTE:
    I need this latest nightly build as it fixes some other stuff that was broken in the previous nightlies.

    #2
    We're not reproducing this problem with the latest nightly build.

    To test we used this example:
    /isomorphic/system/reference/SmartClient_Explorer.html#formDependentSelectsDatabound

    , adding defaultToFirstOption, and a "dataArrived" handler which dumps the selected record to log:

    Code:
    // ---------------------------------------------------------------------------------------
    // Remote Data Example
    
    isc.DynamicForm.create({
        top: 25,
        width: 500,
        numCols: 4,
        autoDraw: true,
        fields: [
            {name:"categoryName", title:"Category", editorType:"select", 
             optionDataSource:"supplyCategory", changed:"form.clearValue('itemName');" ,
    
    // --- Modified to test defaultToFirstOption / dataArrived behavior
             defaultToFirstOption:true,
             dataArrived:function () { 
                 this.logWarn("getSelectedRecord:" + this.echo(this.getSelectedRecord()));
             }
    // --- End of modification
            },
            {name: "itemName", title:"Item", editorType: "select", 
             optionDataSource:"supplyItem", 
             getPickListFilterCriteria : function () {
                var category = this.form.getValue("categoryName");
                return {category:category};
             }
            }
        ]
    });
    If you execute this code and watch the developer console logs, the dataArrived handler displays the selected record without problems.

    If the problem persists, something else must be going on here. If you can show us a way to reproduce the problem we'll take another look

    Regards
    Isomorphic Software

    Comment


      #3
      Issue resolved

      The posted code does work. It must be another observer interfering. Issue is resolved.

      Comment

      Working...
      X