[CLOSED] How Can I do to keep the EventMask after loggin?

Page 2 of 2 FirstFirst 12
  1. #11
    Quote Originally Posted by Daniil View Post
    Please see the screenshot here:
    http://forums.ext.net/showthread.php...ll=1#post46243

    You should open a specific request.
    Daniil, I think that's not the problem, the code in the event lLogin_Authenticate, It is executed...

    rmLogin.AddScript("Ext.getBody().unmask();");
    before that

    Success="Ext.getBody().mask('Ingresando a SigloLabST...');"
    so, the unmask is canceled, and my question is, How Can I do to know that the password is wrong in client-side?

    so, I can to validate in "Success" if I fire the mask or cancel the mask.

    My screen is showing the mask by long time without validation.
  2. #12
    Try to call server-side mask method. Their logic almost the same, but it is easier to control in your case.

    protected void Password_SpecialKey(object sender, DirectEventArgs e)
    {
        if (Authenticated) 
    	{
    		X.Body().Mask("Loading page ...");
    	} 
    	else 
    	{
    		X.Msg.Alert("Wrong password", "Wrong password").Show();
    	}
    }
  3. #13
    Quote Originally Posted by Baidaly View Post
    Try to call server-side mask method. Their logic almost the same, but it is easier to control in your case.

    protected void Password_SpecialKey(object sender, DirectEventArgs e)
    {
        if (Authenticated) 
    	{
    		X.Body().Mask("Loading page ...");
    	} 
    	else 
    	{
    		X.Msg.Alert("Wrong password", "Wrong password").Show();
    	}
    }
    Thank you Baidaly, I put this code, but I get the problem that I say from begin, I have a other idea, from server side I can to mark the TextField as "Invalid" and from clientside to validate in "Success" this state and with this to fire the mask or not.
  4. #14
    Sorry, I don't quite understand your current problem. Do you need to mark password field as invalid or the problem with masking while loading?
  5. #15
    Quote Originally Posted by Baidaly View Post
    Sorry, I don't quite understand your current problem. Do you need to mark password field as invalid or the problem with masking while loading?
    I'm sorry it was just an idea, my problem is the mask.
    Do you need to make you a simple example so you can replicate my problem?
    Last edited by osef; Oct 18, 2013 at 9:37 PM.
  6. #16
    Yes, a sample will be very helpful. Also, provide your requirements.
    Last edited by Baidaly; Oct 19, 2013 at 1:15 AM.
  7. #17
    Quote Originally Posted by Baidaly View Post
    Yes, a sample will be very helpful. Also, provide your requirements.
    This is the more simple example:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Ext.Net.Examples.Examples.Panel.BodyMask.LoginAfterMask.Default" %>
    
    <!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>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
            <ext:TextField 
                ID="TextField2"
                runat="server">
            </ext:TextField>
    
            <ext:TextField 
                ID="TextField1" 
                runat="server">
                <DirectEvents>
                    <SpecialKey
                        OnEvent="Password_SpecialKey"
                        Before="return e.getKey() == Ext.EventObject.ENTER"
                        Success="Ext.getBody().mask('Loading Page...');">
                        <EventMask ShowMask="true" MinDelay="1000" Msg="Loading Page..." />
                    </SpecialKey>
                </DirectEvents>
            </ext:TextField>
    
    
        </form>
    </body>
    </html>
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace Ext.Net.Examples.Examples.Panel.BodyMask.LoginAfterMask
    {
        public partial class Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
            protected void Password_SpecialKey(object sender, DirectEventArgs e)
            {
                if (TextField1.Text.Equals("secret"))
                    Response.Redirect("http://www.ext.net");
                else
                {
                    TextField1.MarkInvalid("The password is incorrect");
                    TextField1.SelectOnFocus = true;
                    TextField1.Focus(true);
                }
            }
        }
    }
    If I write a text other than "secret" mask stays loading and does not go away. How to remove the mask if there is an error in the password?
  8. #18
    Thank you for your sample!

    Try the following:

    <%@ Page Language="C#" %>   
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
     
        }
     
        protected void Password_SpecialKey(object sender, DirectEventArgs e)
        {
            if (TextField1.Text.Equals("secret"))
            {
                Response.Redirect("http://www.ext.net");
                e.ExtraParamsResponse.Add(new Ext.Net.Parameter("showMask", "true", ParameterMode.Raw));
            }
            else
            {
                TextField1.MarkInvalid("The password is incorrect");
                TextField1.SelectOnFocus = true;
                TextField1.Focus(true);
                e.ExtraParamsResponse.Add(new Ext.Net.Parameter("showMask", "false", ParameterMode.Raw));
            }
        }
    </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></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" SourceFormatting="True" />
     
            <ext:TextField
                ID="TextField2"
                runat="server">
            </ext:TextField>
     
            <ext:TextField
                ID="TextField1"
                runat="server">
                <DirectEvents>
                    <SpecialKey
                        OnEvent="Password_SpecialKey"
                        Before="return e.getKey() == Ext.EventObject.ENTER"
                        Success="
                        Ext.getBody().mask('Loading Page...');
                        if (result.extraParamsResponse.showMask === false)
                            Ext.getBody().unmask();">
                        <EventMask ShowMask="true" MinDelay="1000" Msg="Loading Page..." />
                    </SpecialKey>
                </DirectEvents>
            </ext:TextField>
        </form>
    </body>
    </html>
  9. #19
    Quote Originally Posted by Baidaly View Post
    Thank you for your sample!

    Try the following:

    <%@ Page Language="C#" %>   
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
     
        }
     
        protected void Password_SpecialKey(object sender, DirectEventArgs e)
        {
            if (TextField1.Text.Equals("secret"))
            {
                Response.Redirect("http://www.ext.net");
                e.ExtraParamsResponse.Add(new Ext.Net.Parameter("showMask", "true", ParameterMode.Raw));
            }
            else
            {
                TextField1.MarkInvalid("The password is incorrect");
                TextField1.SelectOnFocus = true;
                TextField1.Focus(true);
                e.ExtraParamsResponse.Add(new Ext.Net.Parameter("showMask", "false", ParameterMode.Raw));
            }
        }
    </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></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" SourceFormatting="True" />
     
            <ext:TextField
                ID="TextField2"
                runat="server">
            </ext:TextField>
     
            <ext:TextField
                ID="TextField1"
                runat="server">
                <DirectEvents>
                    <SpecialKey
                        OnEvent="Password_SpecialKey"
                        Before="return e.getKey() == Ext.EventObject.ENTER"
                        Success="
                        Ext.getBody().mask('Loading Page...');
                        if (result.extraParamsResponse.showMask === false)
                            Ext.getBody().unmask();">
                        <EventMask ShowMask="true" MinDelay="1000" Msg="Loading Page..." />
                    </SpecialKey>
                </DirectEvents>
            </ext:TextField>
        </form>
    </body>
    </html>
    Thank you Baidaly this is working
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [CLOSED] custom EventMask msg
    By JCarlosF in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 15, 2013, 9:05 PM
  2. How to use a CustomTarget on an EventMask?
    By paul-2011 in forum 1.x Help
    Replies: 1
    Last Post: Aug 11, 2010, 6:31 AM
  3. Controlling EventMask
    By koss in forum 1.x Help
    Replies: 2
    Last Post: Nov 12, 2009, 11:37 AM
  4. Replies: 1
    Last Post: Aug 11, 2009, 1:28 AM
  5. EventMask can not works?
    By Tom.Hanks in forum 1.x Help
    Replies: 1
    Last Post: Dec 25, 2008, 3:28 AM

Tags for this Thread

Posting Permissions