Problem setting DirectMethod/Event Timeout

  1. #1

    Problem setting DirectMethod/Event Timeout

    Hello guys, i got a problem using Ext Timeout.
    I have searched trough the web and found many solutions, no one works.

    I've tried setting globals

    <script type="text/javascript">
            Ext.Ajax.timeout = 1000;
            Ext.net.DirectEvent.timeout = 1000;
    </script>
    And inside the code.

            public event Func<bool> OnSave;
            [DirectMethod(Timeout = 1000)]
            public bool Save()
            {
                    System.Threading.Thread.Sleep(5000);
                    if (this.OnSave != null)
                        return this.OnSave();
                    return false;
            }
    No one works :(

    Edit: Also setting higher values, the default keeps at 30000 (30 secds).
    While debuggin the javascript, it's set to 1000 (1 sec);
    But don't work.


    Edit2: I forgot to say, while it don't work, after 30 seconds i get a message saying " -1 Transaction aborted".

    Any solution?
    Last edited by glhrmbhnrt; Nov 28, 2012 at 3:06 PM. Reason: Aditional info 2
  2. #2
    Quote Originally Posted by glhrmbhnrt View Post
    Hello guys, i got a problem using Ext Timeout.
    I have searched trough the web and found many solutions, no one works.

    I've tried setting globals

    <script type="text/javascript">
            Ext.Ajax.timeout = 1000;
            Ext.net.DirectEvent.timeout = 1000;
    </script>
    And inside the code.

            public event Func<bool> OnSave;
            [DirectMethod(Timeout = 1000)]
            public bool Save()
            {
                    System.Threading.Thread.Sleep(5000);
                    if (this.OnSave != null)
                        return this.OnSave();
                    return false;
            }
    No one works :(

    Edit: Also setting higher values, the default keeps at 30000 (30 secds).
    While debuggin the javascript, it's set to 1000 (1 sec);
    But don't work.


    Any solution?
    Strange! Here it works perfectly.

    I use the version Ext.NET.1.5.1. What is your version? Put all your code.



    <%@ Page Language="C#" %>
    
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    
    <script runat="server">
    
        [DirectMethod]
        public bool Save ()
        {
            System.Threading.Thread.Sleep( 5000 );
            X.Msg.Notify( "Message", this.TextField1.Text ).Show();
            return true;
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Window runat="server" Title="Example" Padding="5" Height="215" Width="350" Layout="FormLayout" DefaultAnchor="100%">
                <Items>
                    <ext:TextField ID="TextField1" runat="server" FieldLabel="Message" />
                </Items>
                <Buttons>
                    <ext:Button runat="server" Text="Submit" />
                </Buttons>
            </ext:Window>
        </form>
    </body>
    </html>
  3. #3
    Well, here's the code i use.

    <%@ Page Language="C#" %> 
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %> 
    <script runat="server">
     
        [DirectMethod(Timeout = 1000)] // 1 sec ?
        public bool Save ()
        {
            System.Threading.Thread.Sleep( 5000 );       
            return true;
        }
    </script> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
        <script type="text/javascript">
            Ext.Ajax.timeout = 1000; // 1 sec
            Ext.net.DirectEvent.timeout = 1000; // 1 sec
    
            var SaveTemplate = function () {
                barFormStatus.showBusy('Saving...');
                Ext.net.DirectMethods.Save({
                    success: function (result) {
                        if (result) {
                            barFormStatus.clearStatus();
                            barFormStatus.setStatus('Saved');
                            Ext.Msg.alert('Save', 'Saved');
                        } else {
                            barFormStatus.clearStatus();
                            barFormStatus.setStatus('Error to save ....');                        
                        }
                    }
                });
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager ID="rmTicketDispenserConfiguration" runat="server" /> 
            <ext:Viewport ID="vp1" runat="server" Layout="BorderLayout">
                <Items>
                    <ext:Panel ID="pnlTicketDispenserConfigurationTemplate" runat="server" Region="Center">
                        <Content>
                            <textarea id="txtTemplate" runat="server" clientidmode="Static"></textarea>
                        </Content>
                        <BottomBar>
                            <ext:StatusBar ID="barFormStatus" runat="server">
                            </ext:StatusBar>
                        </BottomBar>
                        <ext:Button ID="btnSave" runat="server" Text="Save" IDMode="Ignore">
                            <Listeners>
                                <Click Fn="Save" />
                            </Listeners>
                         </ext:Button>
                    </ext:Panel>
               </Items>
           </ext:Viewport>        
        </form>
    </body>
    </html>
    The timeout is set to 1000 (1 sec) but when i look into it via F12 (IE) or Firebug(Firefox) it shows 30000 (30 sec).
    Postback goes and it stay at 30 seconds, even...

    erico, i'm from Brasil too.
    Last edited by glhrmbhnrt; Nov 28, 2012 at 3:05 PM.
  4. #4
    Quote Originally Posted by glhrmbhnrt View Post
    The timeout is set to 1000 (1 sec) but when i look into it via F12 (IE) or Firebug(Firefox) it shows 30000 (30 sec).
    Postback goes and it stay at 30 seconds, even...
    which version of your EXT?
    This does not happen on my machine. See prints.
    Click image for larger version. 

Name:	chorme_timeout.PNG 
Views:	202 
Size:	37.3 KB 
ID:	5200Click image for larger version. 

Name:	IE_timeout.jpg 
Views:	233 
Size:	94.3 KB 
ID:	5201


    erico, i'm from Brasil too.
    Legal. Anota meu email ai. erico.barrientos@gmail.com
  5. #5
    Quote Originally Posted by erico View Post
    which version of your EXT?
    This does not happen on my machine. See prints.
    Click image for larger version. 

Name:	chorme_timeout.PNG 
Views:	202 
Size:	37.3 KB 
ID:	5200Click image for larger version. 

Name:	IE_timeout.jpg 
Views:	233 
Size:	94.3 KB 
ID:	5201



    Legal. Anota meu email ai. erico.barrientos@gmail.com
    Currently using ext 1.3
    And no way to make this work. Settting this way, or setting on the direct method like this:
    var SaveTemplate = function () {
                barFormStatus.showBusy('Saving...');
                Ext.net.DirectMethods.Save({
                    timeout: 1000,
                    success: function (result) {
                        if (result) {
                            barFormStatus.clearStatus();
                            barFormStatus.setStatus('Saved');
                            Ext.Msg.alert('Save', 'Saved');
                        } else {
                            barFormStatus.clearStatus();
                            barFormStatus.setStatus('Error to save ....');                       
                        }
                    }
                });
            };
    Doesn't work too.

    Firefox 17 & IE 9

    PS: Gonna take screen shots!
    Edit: Here it is

    (Var is set at page startup script)
    Click image for larger version. 

Name:	VARSET.png 
Views:	164 
Size:	21.5 KB 
ID:	5203

    (Look into details and vars are 30000 secs again)
    Click image for larger version. 

Name:	AfterRender.png 
Views:	162 
Size:	8.8 KB 
ID:	5202
    Last edited by glhrmbhnrt; Nov 28, 2012 at 4:34 PM.
  6. #6
    Quote Originally Posted by glhrmbhnrt View Post
    Currently using ext 1.3
    Doesn't work too.

    Firefox 17 & IE 9
    I can not simulate. I created a new project run the following command in the Package Manager Console. >> Install-Package Ext.NET -Version 1.3.0.
    And it worked as before.
    try this
    Ext.onReady(function () {
       Ext.Ajax.timeout = 1000; // 1 sec
       Ext.net.DirectEvent.timeout = 1000; // 1 sec
    });

Similar Threads

  1. [CLOSED] Timeout and DirectMethod
    By bakardi in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 09, 2014, 7:33 AM
  2. Replies: 2
    Last Post: Jan 13, 2012, 4:12 AM
  3. Setting HttpProxy Timeout value Applicaiton-Wide
    By johnharp in forum 1.x Help
    Replies: 1
    Last Post: Nov 25, 2009, 12:22 PM
  4. Setting AjaxEventConfig's Timeout Globally
    By thedarklord in forum 1.x Help
    Replies: 0
    Last Post: Jul 05, 2009, 10:20 AM
  5. [CLOSED] Ajax Event timeout in coolite 0.6.0
    By fquintero in forum 1.x Help
    Replies: 7
    Last Post: Dec 20, 2008, 8:26 AM

Tags for this Thread

Posting Permissions