passwordMask.setMode not working

  1. #1

    passwordMask.setMode not working

    @{
        Layout = "~/Views/Shared/_Layout.cshtml";
        var X = Html.X();
    }
    
    <head>
        <title> Giriş sayfası </title>
    </head>
    
    @X.AntiForgeryField().ID("antiforgerytoken")
    
    @(X.Viewport()
         .ID("viewport")
         .Listeners(x => { x.BoxReady.Handler = "Ext.get(window.document).on('contextmenu', function (e) { e.preventDefault(); return false;});"; })
         .StyleSpec("background-image: url('../../Content/bg-main.png');")
         .RenderTo("body")
         .LayoutConfig(new VBoxLayoutConfig
         {
             Align = VBoxAlign.Center,
             Pack = BoxPack.Center
         })
         .Items(X.FormPanel()
                       .Region(Region.Center)
                       .ID("loginform")
                       .Title("GiriÅŸ yap")
                       .Frame(true)
                       .Draggable(true)
                       //.DraggablePanelConfig(X.DragSource().OnStartDrag(x => { x.Handler = "alert('im not working :(')"; }))
                       //.DraggableConfig(X.ComponentDragger().OnEnd(x => { x.Handler = "alert('im not working :(')"; }))
                       .Width(400)
                       .Icon(Icon.Lock)
                       .BodyPadding(5)
                       .DefaultAnchor("100%")
                       .Items(X.TextField().ID("registry").Name("registry").FieldLabel("Sicil").AutoFocus(true).MaxLength(20).InputType(Ext.Net.InputType.Text).BlankText("Doldurulması zorunlu alan.").AllowBlank(false).AnimateShadow(true),
                              X.TextField().ID("password").Name("password").FieldLabel("Şifre").InputType(Ext.Net.InputType.Password).MaxLength(30).BlankText("Doldurulması zorunlu alan.").AllowBlank(false).AnimateShadow(true).RightButtonsShowMode(ButtonsShowMode.Always).RightButtons(X.Button().AllowDepress(true).EnableToggle(true).ToolTip("Şifreyi göster").Icon(Icon.Eye).Listeners(x => { x.Toggle.Handler = "this.up('textfield').passwordMask.setMode(pressed ? 'showall' : 'hideall'); this.setTooltip('Şifreyi ' + (pressed ? 'gizle' : 'göster'));"; })).Plugins(X.PasswordMask().AcceptRate(1).AllowAnyChars(true)/*.LoginField("#{registry}")*/.Mode(PasswordMaskMode.HideAll).StrictPassword(false).Pattern("a"), X.CapsLockDetector().Listeners(x => { x.CapsLockOn.Handler = "#{password}.showIndicator({iconCls : '#Error', tip : 'CapsLock açık'});"; x.CapsLockOff.Handler = "#{password}.hideIndicator();"; })),
                              X.Checkbox().ID("rememberme").Name("rememberme").FieldLabel("Beni hatırla").AnimateShadow(true))
                       .Buttons(X.Button().Text("Kayıt ol").ID("registerbutton").Listeners(x=> { x.Click.Handler = "window.location = " + JSON.Serialize(Url.Action("Index", "Register")); }).Icon(Icon.UserAdd),
                                X.Button().ID("loginbutton").Text("GiriÅŸ yap").Icon(Icon.Lightning)
                       .FormBind(true)
                       .DirectEvents(de =>
                       {
                           de.Click.After = "#{loginform}.cascade(function(item){if(item.id != 'loginform'){item.disable();}});";
                           de.Click.Complete = "#{loginform}.cascade(function(item){if(item.id != 'loginform'){item.enable();}});";
                           de.Click.EventMask.ShowMask = true;
                           de.Click.Url = Url.Action("Login");
                           de.Click.Method = HttpMethod.POST;
                           de.Click.EventMask.Msg = "Yükleniyor..";
                           de.Click.EventMask.MinDelay = 1000;
                           de.Click.ExtraParams.Add(new Parameter("__RequestVerificationToken", "#{antiforgerytoken}.getValue()", ParameterMode.Raw));
                           de.Click.ExtraParams.Add(new Parameter("rememberme", "#{rememberme}.getValue()", ParameterMode.Raw));
    
                       }))))
    
    <script src="~/Scripts/moment-with-locales.js"></script>
    
    <script>
    
        var now = new Date();
    
        var endofday = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59);
    
        function countdown() {
    
            now = new Date();
    
            Ext.getCmp("localtimelabel").setText('Yedeklemeye kalan süre: '
                + moment.utc(moment(endofday, "DD/MM/YYYY HH:mm:ss").diff(moment(now, "DD/MM/YYYY HH:mm:ss"))).format("HH:mm:ss"));
    
            //App.TaskManager.stopTask(0);
        }
    
    </script>
    
    @(X.Label().Text("Yedeklemeye kalan süre: " + "00:00:00")
               .ShadowMode(ShadowMode.Frame)
               .Icon(Icon.TimeGreen)
               .StyleSpec("font-weight:bold; font-size:100%; position:absolute; bottom:2px; right:2px; z-index:-1;")
               .ID("localtimelabel"))
    
    @(X.TaskManager()
            .ID("TaskManager")
            .Tasks(X.Task()
            .TaskID("Task1")
            //.Repeat(3)
            .Listeners(x =>
            {
                x.Update.Fn = "countdown";
            })
            .DirectEvents(x => { })))
  2. #2
    Hello @elbetbirgun!

    Please provide a runnable and simplified test case, we simply can't handle all that, and figure out a way to have this example working at our side.

    Alternatively, (and in general) if there's an example using the feature you want in Examples Exmplorer, you can just point the example (given the example also breaks).
    Fabrício Murta
    Developer & Support Expert
  3. #3
    thank you, i found the problem.

     X.TextField().ID("password").Name("password").FieldLabel("Åžifre").InputType(Ext.Net.InputType.Password)
    remove input type password after working..
  4. #4
    Thanks for sharing the approach that worked for you!

    I looked up our examples on PasswordMask Plugin and the method was working just fine when I fiddled with it via console commands.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] PasswordMask override issue
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 06, 2015, 12:38 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. Plugin PasswordMask - not found?
    By asics167 in forum 2.x Help
    Replies: 1
    Last Post: Dec 09, 2013, 10:59 AM
  5. [CLOSED] PasswordMask information
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Sep 12, 2013, 11:32 AM

Posting Permissions