Results 1 to 2 of 2

Thread: Fileupload opening up new browser window?

  1. #1

    Default Fileupload opening up new browser window?

    I have the following code successfully posting to the correct url, BUT instead of the response returning to the same window, another window opens and the success handler for the form submission never gets called. Any ideas?

    Code:
    SRM.AddOrderPeptidesDialog = Ext.extend(Ext.Window, {
        initComponent: function() {
            var orderId = this.orderId;
            Ext.apply(this, {
                modal: true,
                title: "Add peptides to order",
                width: 500,
                items: [
                    {
                        xtype: "form",
                        fileUpload: true,
                        bodyStyle: 'padding: 10px 10px 0 10px;',
                        items: [
                            {
                                xtype: 'fileuploadfield',
                                emptyText: 'Select a file',
                                fieldLabel: 'Peptide File',
                                name: 'peptideFile',
                                buttonText: 'Choose a file'
    
                            }
                        ],
                        buttons: [
                            {
                                text: 'Save',
                                handler: function() {
                                    var form = this.findParentByType("form").getForm();
                                    form.submit({
                                        url: "orders/" + orderId + "/peptides",
                                        waitMsg: 'Uploading your file...',
                                        success: function(form, o) {
                                            Ext.Msg.show({
                                                title: 'Result',
                                                msg: o.result.result,
                                                buttons: Ext.Msg.OK,
                                                icon: Ext.Msg.INFO
                                            });
                                        },
                                        failure: function(form, o) {
                                            Ext.Msg.show({
                                                title: 'Result',
                                                msg: o.result.error,
                                                buttons: Ext.Msg.OK,
                                                icon: Ext.Msg.ERROR
                                            });
                                        }
                                    });
                                }
                            }
                        ]
    
                    }
                ]
    
            });
    
            SRM.AddOrderPeptidesDialog.superclass.initComponent.apply(this, arguments);
        }
    });

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    must be something with your browser. The file upload opens up an iframe to make it "ajaxy" but it's not really AJAX (using XMLHttpRequest)

Posting Permissions

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