[CLOSED] How to add Timer-Active Indicator to RemoteValidation

  1. #1

    [CLOSED] How to add Timer-Active Indicator to RemoteValidation

    The remoteValidation stuff is nice. However I would like to show a timer-indicator as soon as the rvTask becomes active (when they start typing). Then when it times out, show the 'busy indicator' when the ajax call is made.

    Is this easy to do, or is this a feature request?
    Last edited by geoffrey.mcgill; Sep 21, 2010 at 10:50 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Well, you can set any required indicator while typing. Please use KeyUp event. When request will be initiated it shows busy indicator
    <%@ Page Language="C#" %>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
        
    <!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></title>
        
        <script runat="server">
            
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!X.IsAjaxRequest)
                {
                    ResourceManager1.RegisterIcon(Icon.TimeGo);
                }
            }
            
            protected void CheckField(object sender, RemoteValidationEventArgs e)
            {
                TextField field = (TextField)sender;
                if (field.Text == "Valid")
                {
                    e.Success = true;
                }
                else
                {
                    e.Success = false;
                    e.ErrorMessage = "'Valid' is valid value only";
                }
    
                System.Threading.Thread.Sleep(3000);          
            }
        </script>
    </head>
    <body>
        <form runat="server">
           <ext:ResourceManager ID="ResourceManager1" runat="server" />
           
           <ext:FormPanel runat="server"
                Title="Remote Validation Form" 
                Padding="5"
                Frame="true"
                LabelWidth="250"
                MonitorValid="true"
                Width="500"             
                DefaultAnchor="-20"
                Height="200">
                <Items>
                    <ext:TextField runat="server" FieldLabel="Server only validation" IsRemoteValidation="true" EnableKeyEvents="true">
                        <RemoteValidation OnValidation="CheckField" ValidationBuffer="1000" />
                        
                        <Listeners>
                            <KeyUp Handler="this.setIndicatorIconCls('icon-timego');" />
                        </Listeners>
                    </ext:TextField>
                </Items>
           </ext:FormPanel>
        </form>    
    </body>
    </html>
  3. #3
    Thanks Vladimir, you can close this one.

    In my case I have a compound field that has several sub-textfields. I was able to just hook panel.el.on('keyup'...) on the compound field's container to trap keys from any text field. This was what I was missing.

Similar Threads

  1. How to work with Timer in EXT.NET
    By archana in forum 1.x Help
    Replies: 1
    Last Post: Oct 24, 2011, 8:29 PM
  2. Replies: 6
    Last Post: Aug 01, 2011, 4:53 PM
  3. [CLOSED] Timer in gridpanel
    By majestic in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 21, 2009, 7:29 AM
  4. [CLOSED] timer
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 12, 2009, 7:56 AM

Tags for this Thread

Posting Permissions