1. #1
    Sencha User Rocco's Avatar
    Join Date
    Nov 2007
    Phoenix, AZ
    Vote Rating
    Rocco is on a distinguished road


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

    [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 Ext.data.SimpleStore({
         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
    Vote Rating
    nassaja-rus is on a distinguished road



    Ext.override( Ext.form.ComboBox, 	{
    		       setValue : function(v){
    		        var text = v;
    		            var r = this.findRecord(this.valueField, v);
    		                text = r.data[this.displayField];
    		            }else if(this.valueNotFoundText !== undefined){
    		                text = this.valueNotFoundText;
    		        this.lastSelectionText = text;
    		        if(this.hiddenField && v != this.emptyText){
    		            this.hiddenField.value = v;
    		        Ext.form.ComboBox.superclass.setValue.call(this, 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
    Ext User
    Join Date
    Mar 2008
    Vote Rating
    JoomlaMan is on a distinguished road


    Default doesnt work.

    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
    Vote Rating
    parkcity is on a distinguished road


    Default Combobox.getValue() returns null

    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

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi