EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  PasswordTextField placeholder

    Posted Mon May 29, 2017 10:12 AM

    Hi man, in my RUI project I have setup a Login widget like below:

    // These are the actual fields where the user will type their data (the "View" part of the "MVC" pattern).    usernameField TextField{ maxLength = 100};passwordField PasswordTextField{ maxLength = 10};    // The Controllers that link the models with their views and handle formatting and validation.usernameController Controller { @MVC { model = utente.UUsername, view = usernameField }, validators = [userIDValidator]};passwordController Controller { @MVC { model = utente.uPwd, view = passwordField }, validators = [PasswordValidator]};  loginform ValidatingForm {        entries = [            new FormField { displayName="* Username:", controller = usernameController },            new FormField { displayName="* Password:", controller = passwordController } ]};

    Is possible to set a placeholder on passwordTextField element.

    Or how to use DojoTextField for password field and set it's input type= password ?

    Some idea?

    @Marcel-D @markevans

     

    Matteo@MR


  • 2.  Re: PasswordTextField placeholder

    Posted Tue May 30, 2017 02:17 AM

    Hi Matteo,

    I don't think that is possible at the moment.

    Maybe you could create a RFE.

     

    But why do you want to set a placeholder to the passwordTextField ?

     

    Kind Regards!

    Marcel-D


  • 3.  Re: PasswordTextField placeholder

    Posted Tue May 30, 2017 02:33 AM

    Hi @Marcel-D 185ef4e2-58bb-459d-b414-d02f00ff390d​, I would like to use the placeholder into password field to not use the front diplay name label and have the widget that takes up less space and is more beautiful visually.

    The alternative would be to use the DojoTextField widget but do not risk setting the text-security style or with js set input type = password.

    pwdField DojoTextField{        id = "passwordLogon",        placeHolder = "password",        maxLength = 10, };

    set syle here:

    pwdField.style = "text-security: disc; -webkit-text-security: disc;  -moz-text-security: disc;";

    set type in js here:

    window.addEventListener("ready", function(){    document.getElementById('passwordLogon').type = 'password';});

     

    Matteo@MR


  • 4.  Re: PasswordTextField placeholder

    Posted Tue May 30, 2017 02:53 AM

    Hi,

    I think it is a good idea to set the input type to password in the JavaScript.

     

    But this should be possible out of the box.

    If you create a RFE I think this will be integrated.

     

    Kind Regards

    Marcel-D


  • 5.  Re: PasswordTextField placeholder

    Posted Thu June 01, 2017 02:27 AM

    Hi,

    if you call your externaltype JavaScript function in the onWidgetLoad event from the DojoTextField it should work.

    Take a look at this:

     

    RUI:

    handler placeholder type RUIhandler{initialUI =[ui            ], onConstructionFunction = start, cssFile = "css/com.triagone.teo.rui.applications.css", title = "placeholder"}    ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children =[DojoTextField            ]};    DojoTextField DojoTextField{layoutData = new GridLayoutData{row = 1, column = 2}, placeHolder = "Password", id = "passwordLogon", onWidgetLoad ::= onWidgetLoad};    function onWidgetLoad(e event in)        CustomFunctions CustomFunctions{};        CustomFunctions.password();    end    function start()    endend

    ExternalType JavaScript:

                                            "password" : function() {                                                var passwordLogon = document                                                                .getElementById("passwordLogon");                                                passwordLogon.type = "password";                                        },

     

     

    Marcel-D


  • 6.  Re: PasswordTextField placeholder

    Posted Thu June 01, 2017 08:13 AM

    Perfect it's work!

    Matteo@MR


  • 7.  Re: PasswordTextField placeholder

    Posted Thu June 01, 2017 08:53 AM

    "password" : function(id) {

         var passwordLogon = document.getElementById(id);
         passwordLogon.type = "password";

     },

    Can it work that way too?

     

     

     

     

     

    Matteo@MR


  • 8.  Re: PasswordTextField placeholder

    Posted Thu June 01, 2017 09:02 AM

    Looks good, try it . Smile

    Marcel-D