Results 1 to 3 of 3

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

    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
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,159
    Vote Rating
    7
      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.

Tags for this Thread

Posting Permissions

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