1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    2
    Vote Rating
    0
    lzm821029 is on a distinguished road

      0  

    Default Unanswered: why form with a upload filed opens a new window while submitting?

    Unanswered: why form with a upload filed opens a new window while submitting?


    While I submit a form that doesn't contain the "filefield" xtype it works well.
    But when a add the filefiled xtype.the form opens a new window that request to the community_save.do. How to prevent the form to opening a new window,just get the response and call my callback method "success"? form definition below:

    Code:
    xtype: 'form',
                url: 'community_save.do',
                bodyPadding: 5,
                items: [
                    {
                        xtype: 'hiddenfield',
                        name : 'id',
                        fieldLabel: 'ID'
                    },
                    {
                        xtype: 'textfield',
                        name : 'name',
                        fieldLabel: '名称',
                        allowBlank: false
                    },
                    {
                        xtype: 'filefield',
                        name : 'map',
                        fieldLabel: '小区地图',
                        msgTarget: 'side',
                        buttonText: 'Choose a Image File'
                    }]
    handler code below:

    Code:
    saveCommunity: function(button) {
        var win    = button.up('window'),
            form   = win.down('form').getForm();
    
        if (form.isValid()) {
            form.submit({
                waitMsg: 'Uploading your map...', 
                success: function(form, action) {
                   Ext.Msg.alert('提示', action.result.msg);
                   win.close();
                   this.loadActivities();
                },
                failure: function(form, action) {
                    Ext.Msg.alert('提示', action.result.msg);
                },
                scope: this
            });
        }
    
    },
    Thanks a lot for your answer!!!



  2. #2
    Sencha User
    Join Date
    Sep 2011
    Posts
    27
    Vote Rating
    0
    Answers
    3
    arcan9ne is on a distinguished road

      0  

    Default


    Does this occur in all browsers?

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    2
    Vote Rating
    0
    lzm821029 is on a distinguished road

      0  

    Default


    yeah ,I think so . It opens a new window in firefox and post a request to about:blank in chrome. you can see the picture below.

    chrome.jpg

Thread Participants: 1

Tags for this Thread