1. #1
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    122
    Vote Rating
    0
    BuckBazooka is on a distinguished road

      0  

    Default Combobox sends Text instead of value

    Combobox sends Text instead of value


    Hi,

    I guess I am doing something wrong but I don't see what. Can someone help me please?

    I have a very simple combobox, which I feed with a 2-dimensional array of value text. When I press submit the text is sent and not the value. In the combobox choices I see the texts.

    Code:
    <html>
    <head>
    <script type="text/javascript" src="../extjs/adapter/ext/ext-base.js?v=3331"></script>
    <script type="text/javascript" src="../extjs/ext-all-debug.js?v=3331"></script>			
    
    </head>
    <body>
    
    <form>
    	<input id="combo" name="combo" type="text" />
    	<input type="submit" name="send" />
    </form>
    
    <script type="text/javascript">
        //<![CDATA[
    	Ext.onReady(function(){
    	    var arrayCombo = [["a", "apple"], ["b", "banana"]];
    	    var combo = new Ext.form.ComboBox({
    		typeAhead: true, 
    		store: arrayCombo, 
    		triggerAction: 'all', 
    		applyTo:'combo', 
    		width:200, 
    		editable:false, 
    		selectOnFocus:true,
    		value: "b",
    		mode: 'local',
    		forceSelection:true
    	    });	
    	});
        //]]>
    </script>
    </body>
    </html>
    
    The combobox shows normally with all the fruit texts, but when I submit, the text is sent and not the value!!!

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,834
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    You haven't specified a valueField for your combo.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Posts
    17
    Vote Rating
    0
    getaceres is on a distinguished road

      0  

    Default


    I have the same problem.
    From the documentation, when a 2-dimensional array is passed as a store, it assumes that the first entry in every item is the value and the second is the text but from my experience it isn't. It always sends the text.

    Also I tried creating a SimpleStore from the multidimensional array and setting displayField and valueField explicitly but it's ignoring the valueField option since it's sending the shown text.

    I'm using Ext 2.1 with prototype adapter (I don't know if it matters).

  4. #4

Thread Participants: 3

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