Results 1 to 7 of 7

Thread: [PR3] IDs not being set on numberfield fields?

    Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
      0  

    Default [PR3] IDs not being set on numberfield fields?

    It looks like IDs aren't being set on form elements that specify an ID.

    This:

    Code:
    {
                        xtype:'fieldset',
                        defaults:{
                            labelWidth:'35%',
                            listeners:{
                                change:myChangeEvent
                            }
                        },
                        items:[
                            {
                                id:'myId',
                                xtype:'numberfield',
                                name:'myMax',
                                label:'MyLabel',
    //                            disabled:true,
                                disabledCls:'disabledVisible'
                            }
                        ]
                    }
    }
    produces this in the DOM:

    Code:
    <input class="x-input-el x-form-field x-input-number" type="number" id="ext-element-290" name="myMax">
    Ext.getCmp('myId') seems to return an element, but Ext.getCmp('myId').getValue() only returns the initial value of the numberfield.

    Somehow the DOM and the ext element are de-synced.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    1. id should only be used for debugging purposes. It isn't worth writing a system to have unique ids. Code for reusability
    2. Using the following code, Ext.getCmp('myId') got the correct field. Ext.getCmp('myId').getValue() returned 0. I then typed 3 into the field and did the getValue() again and it returned 3 as expected. I cannot reproduce this error in PR3.


    Code:
    Ext.create('Ext.form.Panel', {
        fullscreen : true,
        items      : [
            {
                xtype:'fieldset',
                items:[
                    {
                        id:'myId',
                        xtype:'numberfield',
                        name:'myMax',
                        label:'MyLabel',
                        disabledCls:'disabledVisible'
                    }
                ]
            }
        ]
    });
    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
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
      0  

    Default

    I'm using the IDs to drive automated testing. In 1.1.0 and 1.1.1, IDs were being assigned to elements on the DOM.

    getValue and setValue also aren't working for me, so I'll try and create a full example on jsfiddle. I still think not creating actual IDs is an issue.

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Quote Originally Posted by stefankendall View Post
    I'm using the IDs to drive automated testing. In 1.1.0 and 1.1.1, IDs were being assigned to elements on the DOM.

    getValue and setValue also aren't working for me, so I'll try and create a full example on jsfiddle. I still think not creating actual IDs is an issue.
    An id is automatically created for components and are then used for their top level DOM element.
    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

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Posts
    127
    Vote Rating
    0
      0  

    Default

    So if Sencha Touch is automatically assigning IDs, then how do you suggest he do automated testing via say Selenium if the ids change each time the app is run?

  6. #6
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    Indeed if the id isn't being respected, this is a bug and needs to be handled properly. Assigning ids is a necessary feature.

    Sencha Inc

    Jamie Avins

    @jamieavins

  7. #7
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
      0  

    Default

    I didn't have the root cause here of another issue. I'm going to close this and re-post; the IDs are being set properly.

Posting Permissions

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