Setting multiple events in one ext.net button

159 views Asked by At

I have a form with some grids and fields. When I click on submit button, I need to send all information do database. After that, I need to redirect to other page. Actually, my code appears as so, but the redirect event is not firing.

<ext:Button runat="server" Text="Finalizar"  Width="150" ID="Button1" Disabled="true" >
    <DirectEvents>
        <Click OnEvent="SalvarDados"
               Success="
                #{Store1}.sync();
                #{Store2}.sync();
                #{Store3}.sync();
                #{Store4}.sync();
                #{Store5}.sync();
                #{Store6}.sync();
                #{Store7}.sync();
                #{Store8}.sync();
                RedirectPageEvent;">
            <Confirmation ConfirmRequest="true" Title="Confirmação" Message="Confirm?" />
            <EventMask ShowMask="true" Msg="Salvando..." />
        </Click>
    </DirectEvents>
</ext:Button>

And the event:

protected void DirectGeraDocumento(object sender, DirectEventArgs e) {
    Context.Response.Redirect("GeraDocumento.aspx");    
}
1

There are 1 answers

0
Rafael Trojack On BEST ANSWER

Problem solved provisionally . It's working , but I'm not sure about the functioning of the timeout , why this will depend on the server response time. If someone knows a better way, I will apreciate. Thanks!

<Click OnEvent="SalvarDados"
               Success="
                #{Store1}.sync();
                #{Store2}.sync();
                #{Store3}.sync();
                #{Store4}.sync();
                #{Store5}.sync();
                #{Store6}.sync();
                #{Store7}.sync();
                #{Store8}.sync();
                setTimeout(function(){ location.assign('GeraDocumento.aspx'); }, 1500);">
            <Confirmation ConfirmRequest="true" Title="Confirmação" Message="Confirm?" />
            <EventMask ShowMask="true" Msg="Salvando..." />
        </Click>