[FIXED] [#1570] [4.5.0] Problems with ValidationStatus and RemoteVlidation

  1. #1

    [FIXED] [#1570] [4.5.0] Problems with ValidationStatus and RemoteVlidation

    Hi Community !

    Please check the code sample below:

    
    <%@ Page Language="C#" %>
    <%@ Import Namespace="System.Collections.Generic" %>
    
    <script runat="server">
        protected void TextField1_Validation(object sender, RemoteValidationEventArgs e)
        {
            Ext.Net.TextField theTextField = (Ext.Net.TextField)sender;
    
            if (theTextField.Text == "Hola Mundo")
            {
                e.Success = true;
            }
            else
            {
                e.Success = false;
                e.ErrorMessage = "'Hola Mundo' is valid value only";
            }
            System.Threading.Thread.Sleep(1000);
        }
    </script>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>Remote Validation - Ext.NET Examples</title>
    
        <style type="text/css">
            .x-status-error-list 
            {
                z-index: 99999
            }
            .x-status-text 
            {
                color : #777;
            }
    
            .x-status-busy 
            {
                background   : transparent url(images/saving.gif) no-repeat scroll 3px 0px !important;
                padding-left : 25px !important;
            }
        </style>
    
        <script type="text/javascript">
            Ext.define('Ext.ux.statusbar.StatusBar', {
                override: 'Ext.ux.statusbar.StatusBar',
                clearStatus: function (o)
                {
                    if (this.plugins != null)
                    {
                        for (var i = 0; i < App.StatusBar1.plugins.length; i++) {
                            var plugin = App.StatusBar1.plugins[i];
                            if (plugin instanceof Ext.ux.statusbar.ValidationStatus) {
                                plugin.errors.clear();
                                plugin.updateErrorList();
                            }
                        }
                    }
                    return this.callParent(arguments);
                }
            });
        </script>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
            <ext:Window ID="Window1" runat="server"
                    Title="Remote Validation Form"
                    BodyPadding="5"
                    Frame="true"
                    Width="500"
                    DefaultAnchor="100%">
                <Listeners>
                    <Close Handler="App.StatusBar1.plugins[0].msgEl.hide();" />
                </Listeners>
                <BottomBar>
                    <ext:StatusBar ID="StatusBar1" runat="server"
                            DefaultText="Ok"
                            IconCls="">
                        <Plugins>
                            <ext:ValidationStatus ID="ValidationStatus1" runat="server"
                                ShowText="Formulario presenta errores (Click Aqui para más Detalle)"
                                HideText="Click nuevamente para ocultar errores"
                                FormPanelID="FormPanel1"
                                ValidIcon="Accept"
                                ErrorIcon="Exclamation"/>
                        </Plugins>
                    </ext:StatusBar>
                </BottomBar>
                <TopBar>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                            <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                            <ext:Button runat="server" ID="Button1" Icon="Disk" ToolTip="Save Save Save Save" Disabled="true">
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:FormPanel ID="FormPanel1" runat="server"
                            BodyPadding="10"
                            Border="false"
                            DefaultAnchor="100%">
                        <Listeners>
                            <ValidityChange Handler="#{Button1}.setDisabled(!valid);" />
                        </Listeners>
                        <Items>
                            <ext:TextField ID="TextField1" runat="server" 
                                    FieldLabel="Server only validation"
                                    MaxLength="50"
                                    AllowBlank="false"                                                
                                    EnableKeyEvents="true" 
                                    IsRemoteValidation="true" >
                                <RemoteValidation OnValidation="TextField1_Validation" />
                            </ext:TextField>
                        </Items>
                    </ext:FormPanel>
                </Items>
            </ext:Window>
        </form>
    </body>
    </html>
    I’ve implemented a simple example, to illustrate what I mean about my problem,
    i’m using Remotevalidation to validate an individual situation and StatusBar control + ValidationStatus for its presentation,
    but when I’m writing a value on the textfield1, the validation does not work and throws the following error

    Click image for larger version. 

Name:	Error ValidationStatus.jpg 
Views:	55 
Size:	92.9 KB 
ID:	25083

    I accept suggestions ideas or comments

    Thank you for your help!
  2. #2
    Hello Mauricio!

    Thank you for the clean report! We could reproduce the issue and the fix was not really complicated, fortunately. But it means a change in a reasonably long method so we can't really provide a short workaround without doing some ninja moves.

    Anyway, we've just committed the fix to github and you'll be able to use Ext.NET built from sources without the bug if you pull latest changes from github (master branch, so no fancy branch changing and the likes). Is that acceptable to you?

    We can provide a "ninja" workaround but that would require more efforts than the fix itself so may take some time. Regardless of this, you can always investigate the diff from github and apply the fix yourself to the pages you need it.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello FabrÃ*cio !

    Thanks for your reply, in your answer you indicate the following

    "Anyway, we've just committed the fix to github and you'll be able to use Ext.NET built from sources without the bug if you pull latest changes from github (master branch, so no fancy branch changing and the likes). Is that acceptable to you?"

    But, i' ve checked in GitHub - Ext.Net and i can't found it, please your help

    Saludos
    Mauricio.
  4. #4
    Hello Mauricio, and ops! I forgot to link the github issue here. You probably have just to pull/sync afresh the `master` repo and you'll have the working Ext.NET version.

    The github issue I forgot to link is #1570, you'll find the very commits related to the issue linked to the issue itself, provided you are on your github account that has access to the Ext.NET sources repository.

    Let me know if you still can't pull the latest changes.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hi FabrÃ*cio !

    Thanks for your reply, you're providing a great support ! Keep up the great work.

    Saludos
    Mauricio.
  6. #6
    Thanks for the so positive feedback! We really appreciate it, and glad we're able to provide you a good service!

    Let us know if, for some reason, the fix does not actually fix the issue for you.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 4
    Last Post: Mar 22, 2016, 11:16 PM
  2. [FIXED] [2.2] StartupMask problems
    By ascsolutions in forum Bugs
    Replies: 2
    Last Post: Jan 17, 2013, 5:01 PM
  3. Replies: 4
    Last Post: Jan 25, 2010, 11:28 AM
  4. Replies: 2
    Last Post: Dec 02, 2009, 4:57 AM
  5. [FIXED] [V0.8.0] Problems with PaggingToolbar with 0.8.0
    By juanpablo.belli@huddle.com.ar in forum Bugs
    Replies: 10
    Last Post: Feb 13, 2009, 1:27 PM

Posting Permissions