1. #1
    Sencha User
    Join Date
    Jan 2012
    New York City
    Vote Rating
    infernoz is on a distinguished road


    Default Unanswered: Sending parameters via POST during form.submit with filefield

    Unanswered: Sending parameters via POST during form.submit with filefield


    I have a form that has a filefield xtype as one of its items. I'd like the file to be sent to the server during the submit. I'd also like additional parameters to be sent to ther server during the submit as well.

    What I noticed is that when I have the filefield as an item in my form, the parameters arent being sent to the backend. How can I get both the file AND the additional params passed to the server via a POST?

    I am using ExtJS 4.1.0. Here is a snippet of the code:

    Ext.define('BulkSearchForm' ,{
        extend: 'Ext.form.Panel',
        alias: 'widget.bulkSearchForm',
        border: false,
        layout: 'absolute',
        initComponent: function () {
        items: [
                {xtype: 'filefield',
                 name: 'bulksearchfile',
                 fieldLabel: 'Search File',
                 labelWidth: 75,
                 msgTarget: 'side',
                 allowBlank: false,
                 anchor: '60%',
                 x:1, y:5
                {xtype: 'button', id: 'submitBulkSearchButton', text: 'Bulk Search', width: 100, x:410, y:5,
                    handler: function() {
                        var form = this.up('form').getForm();
                        var processorTypeVar = this.up('form').up().up().up().searchProcessorName;
                if (form.isValid()) {
                form.submit({scope: this, waitMsg:'Searching', url: '/CMPDataManagementTool/bulksearch.html',
                                params: {returnFileType: 'filledForm', processorType: processorTypeVar},
                                success: function(form, action) {},
                                failure: function(form, action) {
                                           title:'DMT Search',
                                           msg: 'An error has occured while searching for data. Please contact support or try again.',
                                           animateTarget: this,
                                           icon: Ext.Msg.ERROR,
                                           buttons: Ext.Msg.OK
     ..... .... Here are some other buttons that work properly that dont use the filefield......
    I think using form.doAction() actually works with this setup above, but I want to take advantage of the success: and failure: components of the submit() function and the grey-out feature that occurs during form.submit() where a user cant do anything but wait for the form submit to return.

  2. #2
    Sencha Premium Member
    Join Date
    Mar 2007
    Vote Rating
    mike1993 is on a distinguished road



    perhaps, it was an issues w/ 4.1.0. It works fine w/ 4.2.1
    But I found a snippet in old code. There is no mention of baseParams in current docs though

     var uploadForm = new Ext.FormPanel({
            autoHeight: true,
            method: 'POST',
            url: '/cgi/importFile.cgi',
            baseParams: {
              sid: sid,
              upload_type: "ATTACHMENT"

Thread Participants: 1

Tags for this Thread

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