1. #21
    Ext User
    Join Date
    Sep 2009
    Posts
    3
    Vote Rating
    0
    Codaholic is on a distinguished road

      0  

    Default


    Hi Animal,

    Shameless BUMP!

    When is this ancient bug with a very simple fix going to be fixed? The bug was reported in 2.1 and got sent out in 2.2!

    People are still being bitten by this when using standardSubmit: true
    This issue doesn't seem to have been fixed as of now. I have to use the workaround to get the submit to work even though I've set standardSubmit to true in the Ext.form.BasicForm object which wraps an existing form tag in the html page.

    I wonder when this would be fixed.

    Thanks.

    Codaholic

  2. #22
    Ext User
    Join Date
    Mar 2009
    Posts
    27
    Vote Rating
    0
    TomChiverton is on a distinguished road

      0  

    Default


    The hell ! This is still foobar in the latest 3.x ?!? Does the bug need opening there as well ?

  3. #23
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    This was fixed in rev 4924 for 3.x branch (released with 3.0.1)

  4. #24
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    But what about using the configured URL in the regular Ext.Action.Submit?

  5. #25
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Quote Originally Posted by Animal View Post
    But what about using the configured URL in the regular Ext.Action.Submit?
    Not sure what your point is, the code in svn looks something like below:
    Code:
        submit : function(options){
            if(this.standardSubmit){
                var v = this.isValid();
                if(v){
                    var el = this.el.dom;
                    if(this.url && Ext.isEmpty(el.action)){
                        el.action = this.url;
                    }
                    el.submit();
                }
                return v;
            }
            ...
        },

  6. #26
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Yes, that uses the configured URL if standardSubmit is specified.

    If using a default Ajax submit through the default Ext.form.Action.Submit method, then the configured URL is not used, but must be passed to the submit call.

  7. #27
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    The modified xml form example below went to dude.php when I tested it. On a side point, the validation errors do not show, but I posted a separate ticket for that problem already.

    Code:
    /*!
     * Ext JS Library 3.0+
     * Copyright(c) 2006-2009 Ext JS, LLC
     * licensing@extjs.com
     * http://www.extjs.com/license
     */
    Ext.onReady(function(){
    
        Ext.QuickTips.init();
    
        // turn on validation errors beside the field globally
        Ext.form.Field.prototype.msgTarget = 'side';
    
        var fs = new Ext.FormPanel({
            url: 'dude.php',
            frame: true,
            title:'XML Form',
            labelAlign: 'right',
            labelWidth: 85,
            width:340,
            waitMsgTarget: true,
    
            // configure how to read the XML Data
            reader : new Ext.data.XmlReader({
                record : 'contact',
                success: '@success'
            }, [
                {name: 'first', mapping:'name/first'}, // custom mapping
                {name: 'last', mapping:'name/last'},
                'company', 'email', 'state',
                {name: 'dob', type:'date', dateFormat:'m/d/Y'} // custom data types
            ]),
    
            // reusable eror reader class defined at the end of this file
            errorReader: new Ext.form.XmlErrorReader(),
    
            items: [
                new Ext.form.FieldSet({
                    title: 'Contact Information',
                    autoHeight: true,
                    defaultType: 'textfield',
                    items: [{
                            fieldLabel: 'First Name',
                            name: 'first',
                            width:190
                        }, {
                            fieldLabel: 'Last Name',
                            name: 'last',
                            width:190
                        }, {
                            fieldLabel: 'Company',
                            name: 'company',
                            width:190
                        }, {
                            fieldLabel: 'Email',
                            name: 'email',
                            vtype:'email',
                            width:190
                        },
    
                        new Ext.form.ComboBox({
                            fieldLabel: 'State',
                            hiddenName:'state',
                            store: new Ext.data.ArrayStore({
                                fields: ['abbr', 'state'],
                                data : Ext.exampledata.states // from states.js
                            }),
                            valueField:'abbr',
                            displayField:'state',
                            typeAhead: true,
                            mode: 'local',
                            triggerAction: 'all',
                            emptyText:'Select a state...',
                            selectOnFocus:true,
                            width:190
                        }),
    
                        new Ext.form.DateField({
                            fieldLabel: 'Date of Birth',
                            name: 'dob',
                            width:190,
                            allowBlank:false
                        })
                    ]
                })
            ]
        });
    
        // simple button add
        fs.addButton('Load', function(){
            fs.getForm().load({url:'xml-form.xml', waitMsg:'Loading'});
        });
    
        // explicit add
        var submit = fs.addButton({
            text: 'Submit',
            disabled:true,
            handler: function(){
                fs.getForm().submit({
                //    url:'xml-errors.xml',
                    waitMsg:'Saving Data...'
                });
            }
        });
    
        fs.render('form-ct');
    
        fs.on({
            actioncomplete: function(form, action){
                if(action.type == 'load'){
                    submit.enable();
                }
            }
        });
    
    });
    
    // A reusable error reader class for XML forms
    Ext.form.XmlErrorReader = function(){
        Ext.form.XmlErrorReader.superclass.constructor.call(this, {
                record : 'field',
                success: '@success'
            }, [
                'id', 'msg'
            ]
        );
    };
    Ext.extend(Ext.form.XmlErrorReader, Ext.data.XmlReader);

  8. #28
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Yes, it does work, so I think this ticket can be closed. Buried down in the Action class is

    Code:
        getUrl : function(appendParams){
            var url = this.options.url || this.form.url || this.form.el.dom.action;
            if(appendParams){
                var p = this.getParams();
                if(p){
                    url = Ext.urlAppend(url, p);
                }
            }
            return url;
        },

  9. #29
    Ext User
    Join Date
    Mar 2009
    Posts
    27
    Vote Rating
    0
    TomChiverton is on a distinguished road

      0  

    Default


    Still doesn't give a good experience though, as it's busted in the current public release.