Results 1 to 2 of 2

Thread: success versus failure when there's an iframe in the house

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    103
    Answers
    2
    Vote Rating
    0
      0  

    Default success versus failure when there's an iframe in the house

    Using 4.1:

    I create a form with:

    Code:
                   xtype:'form',
                    title:'Test Form (fileupload) for Document View',
                    width: '100%',
                    url:  bt_wd40_appurl + "/docView/documentViewMultipart",
                    items:[
                        {
                            xtype:'fileuploadfield',
                            name:'data',
                            anchor: '100%',
                            fieldLabel:'File to process'
                        },
                        {
                            xtype: 'hiddenfield',
                            name: 'options'
                        }
                    ]
    and in a button handler, I call submit.

    If the server returns an error, the extjs runtime tries to call the 'success' handler. Then it gets an exception when it tries to decode an empty string as json.

    Is this expected? Is there a recommended way of setting up errors on the server side to cope?

    Worse yet, success maps to failure!

    Success passes to line 43113 of ext-all-debug-with-comments.js, which passes the response to this.processResponse. Since what I return does not include a field names 'success', it fails. I'll add a field named success, but where did I miss the doc insisting on this?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716
    Vote Rating
    504
      0  

    Default

    When you have a callback:

    Code:
    success: function(){
    // get success or failure sent from server; planned response
    }
    failure: function(){
    // server did not respond, ajax timeout .. call failure; unplanned
    }
    Scott

Posting Permissions

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