Direct Event with IsUpload doesnt fire Success

  1. #1

    Direct Event with IsUpload doesnt fire Success

    I am using this button to UPLOAD an excel file, modify it and then return it to the user via MVC FileResult (byte[]) in one shot. However, Success is never called. If i change it to After, it works.
    thanks!
    /Z

                            <ext:Button ID="XlsSaveButton" runat="server" Text="Run Report" Disabled="true">
                                <DirectEvents>
                                    <Click 
                                        Url="/ta/XXXX/RunXXX" 
                                        Timeout="60000"
                                        IsUpload="true"
                                        CleanRequest="true" 
                                        Method="POST"
                                        Before="Ext.net.Mask.show();"
                                        Success="alert('Your file will be downloaded shortly');"
                                        Failure="Ext.Msg.show({
                                            title:   'Error',
                                            msg:     result.message || result.errorMessage,
                                            buttons: Ext.Msg.OK,
                                            icon:    Ext.MessageBox.ERROR
                                        });">
                                        <EventMask MinDelay="250" />
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
  2. #2
    Hello Zev!

    I'm afraid the IsUpload setting limits direct events in regard to the aspect you want to explore due to the nature uploads works in browsers.

    Instead, you may tie the After event to the direct method to query the server (again) and check if the upload proceeded accordingly. Then you'd be able to enjoy the proper event's responses, as well as being able to further check the upload for consistent data, etc.

    Here's a thread about this issue that may help a bit: DirectEvent isUpload=true block other actions

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] success is not getting fired while using isUpload=true
    By barnali in forum 3.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 16, 2015, 12:40 PM
  2. Replies: 0
    Last Post: Nov 08, 2012, 9:48 AM
  3. Replies: 6
    Last Post: Jul 24, 2012, 7:23 PM
  4. SortChange Direct Event doesn't fire at all
    By cicaglisa in forum 1.x Help
    Replies: 1
    Last Post: May 23, 2012, 5:31 PM
  5. [CLOSED] [1.0] Issue with success property on direct event of textfield
    By bryantharpe in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 07, 2010, 5:06 PM

Posting Permissions