Hybrid View

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1238 in a recent build.
  1. #1
    Sencha Premium Member
    Join Date
    Aug 2010
    Posts
    24
    Vote Rating
    1
    jensen83 is on a distinguished road

      0  

    Exclamation [PR3] selectfield getValues issue

    [PR3] selectfield getValues issue


    If the "value" config is passed to a selectfield, "getValue()" does not call the specified "getValue" function defined in Ext.field.Select (on line 49921 in sencha-touch-all-debug), but the optimizedGetter function (line 3285).

    Maybe it's an even bigger problem for other fields or components, too.

    Example:

    Code:
    var fieldset = new Ext.form.Panel({
        items: [{
            xtype: 'fieldset',
            items: [{
                xtype: 'selectfield',
                store: [...],
                value: 1 // this disturbs the config
            }]
        }]
    });

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thank you for the report.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha User
    Join Date
    Apr 2008
    Posts
    17
    Vote Rating
    1
    minorbug is on a distinguished road

      0  

    Default


    Is there a workaround to get the value? I'm getting the same issue with sliderfields in a fieldset.

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    18
    Vote Rating
    2
    anj is on a distinguished road

      0  

    Default


    Another error on getValues is that a toogle returns now an Array and not the given value.

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    45
    Vote Rating
    0
    lennonnz is on a distinguished road

      0  

    Default


    I too can reproduce the problem. See below on a snippet of my code on how I "worked" around the problem on PR3. on PR2 it works fine. If I don't set a default value then getValue(), works fine. Its only then you set a value you get returned a object which you have to go into. Unless I'm doing this wrong and its working by chance 100% of the time :-)

    Code:
    {
                                    xtype: 'selectfield',
                                    name : 'carriercountry',
                                    label: 'Country',
                                    valueField : 'countryid',
                                    displayField : 'countryname',
                                    value: country_code,
                                    store : CountriesStore,
                                    listeners: {
                                            change: function(newOption) {
                                                    apncountry = newOption.getValue().data.countryid; // PR3
                                                    //apncountry = newOption.getValue(); // PR2     
                                                    CarriersStore.read({ params : {country:apncountry} });
                                                    }
                                            }
                                    },

  6. #6
    Sencha User semiaddict's Avatar
    Join Date
    Mar 2010
    Posts
    45
    Vote Rating
    2
    semiaddict is on a distinguished road

      0  

    Default


    I had the same issue with a sliderfield.
    As a workaround, I set the value using the setValue function instead of setting it through the config.

    I'm guessing the issue happens because of automatic getter and setter functions set on each config, but I'm not sure as I don't know how that works.
    If that's indeed the case, it should be fairly easy to fix, by checking if a function already exists with the same name before creating the getter or setter.
    ---
    Oussama Mubarak // Semiaddict

  7. #7
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    This issue has been fixed for the next release.

    Sencha Inc

    Jamie Avins

    @jamieavins