Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2685 in a recent build.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    7
    Vote Rating
    1
    derekbal is on a distinguished road

      0  

    Default radiofield with value of 0 returns boolean true instead of 0.

    radiofield with value of 0 returns boolean true instead of 0.


    If you have a couple set of two radiofields with the same name, one having a value of 0 and the other a value of 1, when the radiofield with the value of 0 is checked, the value shown in form.getValues() is a boolean true. Any other integer value works properly except for 0.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,084
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report

    Code:
    new Ext.form.Panel({
        fullscreen : true,
        items      : [
            {
                xtype : 'radiofield',
                name  : 'test',
                value : 0,
                label : 'Zero'
            },
            {
                xtype : 'radiofield',
                name  : 'test',
                value : 1,
                label : 'One'
            },
            {
                xtype   : 'button',
                text    : 'Get Values',
                handler : function(button) {
                    var form   = button.up('formpanel'),
                        values = form.getValues();
    
                    console.log(values);
                }
            }
        ]
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Fixed for the next release. Thanks.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Thread Participants: 2

Tags for this Thread