Results 1 to 4 of 4

Thread: [2.1svn2134] empty ComboBox.getValue() returns emptyText in SVN build

  1. #1
    Sencha User Rocco's Avatar
    Join Date
    Nov 2007
    Phoenix, AZ

    Default [2.1svn2134] empty ComboBox.getValue() returns emptyText in SVN build

    It appears that the changes made in SVN revision 2134 to Ext.form.Field are causing an empty ComboBox's value to be set to the emptyText value. I didn't look too much into the code that seems to have caused this, but I believe it's a change made to the afterRender method.

    Here's some simple code to reproduce the bahavior I'm experiencing, although I'm sure it could be duplicated using any example with a TextField (or any component derived from Field) that has the emptyText property defined.

    var combo = new Ext.form.ComboBox({
     id: 'testCombo',
     emptyText: 'Select One...',
     typeAhead: true,
     triggerAction: 'all',
     mode: 'local',
     store: new{
         fields: [
             {name: 'id'},
             {name: 'name'}
         data : [
             [1, 'Chevrolet'],
             [2, 'Volkswagen'],
             [3, 'Honda'],
             [4, 'Ford']
         sortInfo: {field: 'name', direction: 'ASC'}
     displayField: 'name',
     valueField: 'id',
     forceSelection: true,
     allowBlank: false,
     renderTo: document.body
    var button = new Ext.Button({
     text: 'Get Value',
     renderTo: document.body,
     handler: function() {{
             title: 'Hello!',
             msg: 'The value of the combobox is \'' + Ext.getCmp('testCombo').getValue() + '\'',
             icon: Ext.MessageBox.INFO,
             buttons: Ext.MessageBox.OK,
             animEl: 'testCombo'
    Running the above with the SVN build, both Ext.getCmp('testCombo').value and Ext.getCmp('testCombo').getValue() return 'Select One...'. The same in Ext 2.1 returns ''.

    Please let me know if you need more info or if I can be of help.


  2. #2
    Ext User nassaja-rus's Avatar
    Join Date
    Mar 2007


    Ext.override( Ext.form.ComboBox, 	{
    		       setValue : function(v){
    		        var text = v;
    		            var r = this.findRecord(this.valueField, v);
    		                text =[this.displayField];
    		            }else if(this.valueNotFoundText !== undefined){
    		                text = this.valueNotFoundText;
    		        this.lastSelectionText = text;
    		        if(this.hiddenField && v != this.emptyText){
    		            this.hiddenField.value = v;
    , text);
    		        this.value = v;
    Last edited by mystix; 9 Jun 2008 at 2:16 AM. Reason: use [code][/code] tags
    -= miu-miu =-

    Linux, Perl, GNU, Open Source, Ajax, Ubuntu 9.04

  3. #3

    Default doesnt work.

    Code doesn't work as posted either before or after multiple comboboxes are created. If the solution is only for an application which uses one combobox, can it please be extended for n comboboxes?

  4. #4
    Sencha User
    Join Date
    Jul 2011

    Default Combobox.getValue() returns null

    Does any body has a solution to the following problem?

    I have combobox on a panel with following combobox code:

    xtype: 'combobox',
    name : 'batchgroup',
    fieldLabel: 'Batch Group',
    id: 'batchgroup',
    store: 'dp.Abc',
    queryMode: 'local',
    displayField: 'name',
    valueField: 'abbr',
    //forceSelection : true,
    editable: false,
    autoSelect: true,
    emptyText: "<Select Value>",
    columnWidth: .5

    Later in the code when i try to get the value using the following code, I get a null value even after a user selects
    a value in the above combobx

    var batchgroup = Ext.getCmp('batchgroup');

    console.log('batchgroup value... '+batchgroup.getValue());

    Here the batchgroup.getValue() so retrieved is null

Posting Permissions

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