1. #1
    Sencha User
    Join Date
    Sep 2008
    Posts
    107
    Vote Rating
    0
    foxmarco is on a distinguished road

      0  

    Exclamation Combo + Transform + send not right data.

    Combo + Transform + send not right data.


    I've tried to convert an html select with options via 'transform' attribute of extjs combo.
    It does work but when i submit the form the value send to the server is the displayField and not the valueField. What's wrong?

    Code:
     
    <select id='menus' name="menus">
       <option value='m1'>Menu 1</option>
        <option value='m2'>Menu 2</option>
    </select>
     
     
        // ComboBox transformed from HTML select
        Ext.create('Ext.form.field.ComboBox', {
            typeAhead: true,
            transform: 'menus' ,
            width: 200,
            id:'menus',
            name:'menus'
        });
    Thanks.

    I hope someone could help me.

  2. #2
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    If the store is autocreated, which it is if you're transforming a SELECT, then it creates two columns in the store - "field1" and "field2" - it then sets both displayField and valueField to "field1", and if (!store.expanded) (from the source), sets displayField to "field2".

    I would look at the values of displayField and valueField in the debugger - it may be that you need to change the value of valueField.

    Also, it's VERY possible (haven't validated this myself because transform wasn't in the early version of 4.0 I started with) that transform support is NOT creating the hidden field it used to in 3.X - a DOM inspection will help there.

    Hope this helps - converting ComboBoxes to 4.0 was less than "fun".

    stevil

  3. #3
    Sencha User
    Join Date
    Sep 2008
    Posts
    107
    Vote Rating
    0
    foxmarco is on a distinguished road

      0  

    Default


    It's really a problem. I confirm about displayField (field2) and valueField (field1) but the main problem is unresolve. On submit the value send to server is always the value of field2. The strange is about getRawValue().... it's the value of field2!!

    I think ExtTeam will do something about this problem becouse combobox are not useful at the moment!

  4. #4
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    Well, getRawValue() is usually going to be what's in displayField - it's the unvalidated, unprocessed value, so that makes sense.

    Perhaps you've found a bug here - maybe one thing to do is to create a small page with TWO selects with different ids but the same list values. Use transform on one, leave the other as is. Then, as long as you can demonstrate in Firebug or Fiddler that the behavior is different, submit that example in the Bugs forum.

    I KNOW that they're not creating a backing hidden field any more, so you don't get BOTH values sent. Your behavior is odd, though. I'd follow the Bug route until someone at Sencha tells you different.

    stevil

  5. #5
    Sencha User
    Join Date
    Sep 2008
    Posts
    107
    Vote Rating
    0
    foxmarco is on a distinguished road

      0  

    Default


    I've solved in another way. I've also read yours other thread about the ovveride of Combo, but i prefer solution, only becouse i can remove in the futute with out problem.

    Code:
     
    
    submitValues:
    function() { this.getForm().getFields().each(function(field) { if (field.xtype == 'combobox') { Ext.getCmp(field.id).setValue(field.getValue()); Ext.getCmp(field.id).setRawValue(field.getValue()); } }); }


    I call this method in my base form panel before submit the html form.
    For each combo it set the real value into the 'html input' of jsp page.
    And this method work for me.

    What do you think?

  6. #6
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    I think that the simplest solution that solves your problem is probably best, and this certainly seems so for your situation! It looks like it should work just fine.

    Good luck with it, and let me know how it works out for you...

    stevil

Thread Participants: 1

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