Facility Control

 View Only
  • 1.  Password field - Password protect only portion of a custom panel

    Posted 03-07-2024 08:19

    Hi again!

    Sitting here with a problem I did not expect.
    We want to password protect only a portion of a custom panel, to hide presets that should not be messed with for example.
    And we simply have those buttons disabled or hidden in a canvas that we then reveal when you click a button and type in the password in another canvas that shows up.
    However, this is all in clear text for anyone over my shoulder to read. Is there a way to make a text field into a password-style field?

    I've been trying to search here on the forum, but I'm only finding the millions of posts on how to password protect a dashboard from being edited.
    Wich I do know how to do.



    ------------------------------
    Aleksander Stalsberg
    Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
    Norway
    ------------------------------


  • 2.  RE: Password field - Password protect only portion of a custom panel

    Ross Staff
    Posted 03-07-2024 09:29

    Hi Aleksander
    Yes, there is a hidden widget hint for password fields.  If you go into the Parameters dialog, you can modify the hint of any text field and change it to 'password' to get the hidden characters.

    Just to note: the password itself is still in clear text and written to the parameter (you'll probably want to also make it stateless by selecting the 'do not save changes made to parameter value' checkbox).  This widget hint only changes how it is shown in the user interface.



    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 3.  RE: Password field - Password protect only portion of a custom panel

    Posted 03-07-2024 13:36

    Aha! I knew it had to be there somewhere.
    And the stateless checkbox was a nice touch as well. Never really tried that, but that's a good suggestion for sure!

    Thanks again!



    ------------------------------
    Aleksander Stalsberg
    Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
    Norway
    ------------------------------



  • 4.  RE: Password field - Password protect only portion of a custom panel

    Posted 03-07-2024 16:37

    Follow up question for you @James Peltzer - How do you also set a button to be disabled on DashBoard opening/load.
    Then I can change state of this with the ogscript.setEnabled('ID', true);



    ------------------------------
    Aleksander Stalsberg
    Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
    Norway
    ------------------------------



  • 5.  RE: Password field - Password protect only portion of a custom panel

    Ross Staff
    Posted 03-07-2024 16:52

    You cannot specify enabled/disabled at the time the button is created.  You will need to use an <ogscript handles="onload">....</ogscript> block to set your buttons to the correct state when the panel is opened.  The most common paradigm I have seen for disabling a large block of controls is to use an <abs/> to cover the part of the application you want to protect and then use the password prompt to hide the <abs/>.



    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 6.  RE: Password field - Password protect only portion of a custom panel

    Posted 03-07-2024 17:15

    So this wouldnt work with an API tag that run script on load?
    And then set the buttons as disabled there?

    We were thinking about covering them with <abs/>, but the buttons themselfs are withing a responsive table that changes size based on the width of the panel, and positioning an <abs/> to cover that is more troublesome than I would like to admit. Though it's only 3-4 buttons on this case, wich would be no hassle to disable. For larger areas and a fixed with panel, that would definetly be my sollution.



    ------------------------------
    Aleksander Stalsberg
    Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
    Norway
    ------------------------------