TheNovice

Asking password before setting a component

Recommended Posts

I am using an Edit Box Component and on click of Set button I want some script to run where I can ask for password, match the password and then set the channel value.

I can do it by just providing a normal text box and separate button which will run the action, it is more work as I have many Edit boxes where I want to implement something like that. Also one more problem with that is by using system.EntryDialog I can ask for password but it displays plain string and not '***', is there any way to make text in EntryDialog to be password type ('***').

 

Or, Is there any other efficient way to do the whole process which I am trying to do because I have multiple set components.

Thanks.

Share this post


Link to post
Share on other sites

First, you might want to check this post I made about using Edit boxes:

https://support.azeotech.com/topic/3233-edit-boxes-in-hmi-software/

At present there is no way to make EntryDialog cover passwords.  You'd really just have to create your own popup window with a password edit box and a nice function to call it.

As for the first part, you might try using the OnChange event of the Edit Box.

 

Share this post


Link to post
Share on other sites

I have already implemented it using OnChange event.

I'll try to do everything in a pop up as said in the link with some valid reasons, thanks for the link.

 

Also, I would like to know, is there anything similar to 'this' keyword in Daqfactory? because it can help to keep the code clean while writing a function similar to this.

Share this post


Link to post
Share on other sites

There is in the next release, which will probably be in January.  It's not quite "this" as that returns a pointer, but rather a string that returns the component name, called, appropriately, "ComponentName".  So you can pass this to a common function, then use execute() or evaluate() to access the component by name.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now