Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Fieldset RadioField getGroupValue

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2955 in a recent build.
  1. #1

    Default Fieldset RadioField getGroupValue

    I have been working on a view whereby I have grouped checkboxes and have tried to get the value of the checked item upon clicking the submit button. I always received the return value of true so I decided to try the example on my version (2.0.1). I have found that this approach no longer works as described in this example as it still only returns "true" and not the actual value. Can someone point me in the right direction or is this a bug in the new release?

    http://senchaexamples.com/2012/03/13...encha-touch-2/

    Code:
    Ext.create('Ext.form.Panel', {
        fullscreen : true,
        items      : [
            {
                xtype  : 'toolbar',
                docked : 'top',
                items  : [
                    {
                        text    : 'get checked',
                        handler : function () {
                            var products = Ext.ComponentQuery.query('radiofield[name=product]');
                            Ext.Msg.alert('getGroupValue()', products[0].getGroupValue());
                        }
                    }
                ]
            },
            {
                xtype        : 'fieldset',
                title        : 'Products:',
                instructions : 'Please select a product.',
                defaults     : {
                    labelWidth : 180
                },
                items        : [
                    {
                        xtype : 'radiofield',
                        name  : 'product',
                        label : 'Ext JS',
                        value : 'extjs'
                    },
                    {
                        xtype   : 'radiofield',
                        name    : 'product',
                        label   : 'Sencha Touch',
                        value   : 'senchatouch',
                        checked : true
                    },
                    {
                        xtype : 'radiofield',
                        name  : 'product',
                        label : 'Sencha Designer',
                        value : 'designer'
                    }
                ]
            }
        ]
    });

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448

    Default

    The real issue is the getValue method returning true or null on the radio instead of the value config.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3

    Default

    I took a look at the code base and yes...you are correct. The getGroupValue does call the getValue. With that, if the value is set to "extjs" as per the example I posted then why is the getValue call returning true? More specifically, you can go to the link I posted and see that the return value there is accurate and that begs the question of what is the difference in implementation between 2.0.0 (what the example is running on) and 2.0.1 (what I am)?

  4. #4

    Default

    @Mitchell...is there some kind of cryptic answer in your response or are you agreeing that this is a bug?

  5. #5
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448

    Default

    Look at the top, this bug has been open since I replied.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  6. #6

    Default

    Ok...I am new to these forums so I didn't see it. So was this working in 2.0.0?

  7. #7

    Default

    So...was 2.0.1 not tested or what. I found another potential bug in the following panel.
    Basic fieldset and I want to call the getTitle() method to retrieve the value of the fieldset title. Instead of returning the value like the documentation states it returns an entire class.

    From Chrome Console

    Ext.getCmp('pets').getTitle()

    Ext.apply.create.Class

    • _baseCls: "x-form-fieldset-title"
    • _disabledCls: "x-item-disabled"
    • _docked: "top"
    • _html: "Do you have pets?"
    • _itemId: "ext-title-3"
    • _title: "Do you have pets?"
    • config: Ext.Object.classify.objectClass
    • element: Ext.apply.create.Class
    • eventDispatcher: Ext.apply.create.Class
    • getEventDispatcher: function () {
    • getId: function () {
    • getObservableId: function () {
    • getUniqueId: function () {
    • id: "ext-title-3"
    • initConfig: function (){}
    • initialConfig: Object
    • initialized: true
    • innerElement: Ext.apply.create.Class
    • innerHtmlElement: Ext.apply.create.Class
    • observableId: "#ext-title-3"
    • onInitializedListeners: Array[0]
    • parent: Ext.apply.create.Class
    • referenceList: Array[1]
    • renderElement: Ext.apply.create.Class
    • rendered: true
    • __proto__: TemplateClass








    Ext.define('Maint.view.Test', {
    extend: 'Ext.form.Panel',
    xtype: 'newformtest',
    id: 'newformtest',
    requires: [
    'Ext.field.Radio',
    ],


    config: {
    fullscreen: true,
    title: 'New Request',
    items: [
    {


    xtype: 'fieldset',
    id: 'pets',
    title: 'Do you have pets?',
    defaults: {
    xtype : 'radiofield',
    labelWidth: '35%'
    },
    items: [
    {
    name : 'pet',
    value: 'hellyeah',
    label: 'Yes',
    },
    {
    name : 'pet',
    value: 'hellno',
    label: 'No',
    }
    ]

    },
    {
    xtype: 'button',
    ui: 'round',
    text: 'Submit',
    id: 'submitbutton'
    },
    ]
    }


    });

  8. #8
    Ext JS Premium Member
    Join Date
    Oct 2010
    Posts
    80

    Default

    It would be nice if you guys would put a radio.getGroupValue() call/unit test into the Kitchen Sink. I remember this breaking for a while in Sencha 1.x as well. I searched the entire Sencha examples folder for getGroupValue and came up with nothing. If you never use it or test it, it's a lot easier to break it I'm guessing.

  9. #9
    Sencha User rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,159

    Default

    Perhaps this is just an old bug, but I cannot replicate this in the latest SDK. I've added unit tests for this functionality so if it ever breaks again, we will know.

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

  10. #10
    Sencha User rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,159

    Default

    Quote Originally Posted by admiralman View Post
    So...was 2.0.1 not tested or what. I found another potential bug in the following panel.
    Basic fieldset and I want to call the getTitle() method to retrieve the value of the fieldset title. Instead of returning the value like the documentation states it returns an entire class.
    This is also working, but I've added a unit test for it anyway.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Page 1 of 2 12 LastLast

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
  •