[CLOSED] PasswordMask override issue

  1. #1

    [CLOSED] PasswordMask override issue

    I have a js file that defines all of the Ext.Net overrides (bugs and enhancements) and I include it within my MasterPage.aspx. Everything works fine until I call a page that does not use the plugin PasswordMask. The following javascript error occurs

    Uncaught TypeError: Cannot read property 'override' of undefined

    Do I need to pull this override out and only call it when needed?

    Below is an example with the latest override from Thread 58011, but I commented out the Plugin.

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html>
    <html>
    <script runat="server">
    
    </script>
    <head runat="server">
        <title></title>
        <style type="text/css">
        </style>
        <script type="text/javascript">
            Ext.net.PasswordMask.override({
                renderHiddenField: function () {
                    var field = this.getCmp();
    
                    if (field.ownerCt) {
                        field.ownerCt.items.add(this.hiddenField);
                    } else {
                        this.hiddenField.render(field.el.parent());
                    }
    
                    field.inputEl.on("keydown", this.onKeyDown, this);
                },
    
                onKeyDown: function (e) {
                    var me = this,
                        oldValue = me.cmp.lastValue || "";
    
                    if (me.mode != "hideall") {
                        return;
                    }
    
                    setTimeout(function () {
                        var newValue = me.cmp.getValue(),
                            key = e.getKey();
    
                        if ((newValue.length < oldValue.length) && ((key === e.BACKSPACE) || (key === e.DELETE))) {
                            me.onDelete(me.getCaretRange(), oldValue.length - newValue.length);
                        } else {
                            me.maskChars(newValue);
                        }
    
                        me._maskAll();
                    }, 0);
                }
            });
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    
        <ext:Panel runat="server" Title="Password Mask Issue" Margin="5" Height="200" Width="400" BodyPadding="10" UI="Danger">
            <Items>
                <ext:TextField ID="Password" runat="server" FieldLabel="Password" ClientIDMode="Static" SelectOnFocus="true">
                    <%--<Plugins>
                        <ext:PasswordMask runat="server" Mode="HideAll" Pattern="z" AllowAnyChars="true" />
                    </Plugins>--%>
                </ext:TextField>
            </Items>
            <Buttons>
                <ext:Button runat="server" Text="Login" Handler="Ext.Msg.alert('Password ...', App.Password.getPassword());" />
            </Buttons>
        </ext:Panel>
    </body>
    </html>
    Last edited by Daniil; Apr 06, 2015 at 9:18 AM. Reason: [CLOSED]
  2. #2
    Hi Chris,

    PasswordMask is an UX. It means that it is not included into the combined JavaScript file (extnet-all.js). It is in an individual source file and it is only automatically loaded if a PasswordMask is detected on the page.

    Do I need to pull this override out and only call it when needed?
    Yes.

    Or always preload the PasswordMask resources in, say, Page_Load.
    ResourceManager.RegisterControlResources<PasswordMask>();
  3. #3
    I have currently decided to break it out into its own js. Looking at other overrides you have suggested overtime I thought I would have problems with the following:

    • Ext.net.Callout.override (Because it follows the same pattern as Ext.net.PasswordMask.override)
    • Ext.ux.RowExpander.override (Because you mentioned UX is the previous post)


    But I have not experienced any javascript errors.
  4. #4
    Ext.net.Callout.override (Because it follows the same pattern as Ext.net.PasswordMask.override)
    Sorry, I don't understand. Please clarify.

    The Callout's JavaScript sources is in the main file - extnet-all.js.

    Ext.ux.RowExpander.override (Because you mentioned UX is the previous post)
    It is an exclusion. The RowExpander JavaScript sources is in the main file as well. As far as I can remember we renamed it to Ext.net.RowExpander in Ext.NET v3.
  5. #5
    Sorry I didn't mean to confuse anyone. Everything is working fine. You can close this thread.

Similar Threads

  1. Replies: 4
    Last Post: Apr 03, 2015, 8:05 AM
  2. Replies: 3
    Last Post: Mar 17, 2015, 2:21 PM
  3. Plugin PasswordMask - not found,
    By asics167 in forum 2.x Help
    Replies: 2
    Last Post: Dec 12, 2013, 5:05 AM
  4. [CLOSED] PasswordMask information
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Sep 12, 2013, 11:32 AM
  5. [CLOSED] GridView override portability issue
    By vadym.f in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Aug 16, 2013, 3:42 AM

Posting Permissions