70 views
in GUI Development by

Hi Team,

I am trying to implement password feature with text editor, where text entered by the user need to be masked based on push button selection.

I had adopted some of the implementation to mask the user input text. Now i am trying to mask and unmask the user input string in password text based on push button action. Here text editor component is being accessed in LogIn dialog and trying to access text editor page properties in push button slot to change the text string as per the user selection, but i am unable to access the text editor properties in slot method of push button.

How can i toggle the masking of user input text.

Reference project: TextEdit_Password

1 Answer

0 votes
by
 
Best answer
Hello,

the link to the referenced project doesn't seem to work.

Best regards

Paul Banach
by
Hi Paul,

Apologies. I had corrected the link, please do try now.
by

You have a method Slot_ShowPassword connected to button's OnEnter property:

Better would be to connect the method to OnActivate. Then the method is signaled when the user really activates the button (presses and releases it). OnEnter is triggered each time the user moves the finger inside the area of the button. Thus also multiple times during an active touch interaction:

As next you want the method to toggle the editor's property ShowPassword. For this purpose adapt the method:

In this manner the editor is informed about the desired display mode. However, this remains without effect, since the implementation of the onset method OnSetShowPassword limits to save the mode. You would need to trigger the editor to update itself or reprocess the text so it appears according to the new setting.

The simplest would be to reassign the current password string to the editor:

I hope it helps you further.

Best regards

Paul Banach

by
Thank you, Paul.

I am able to toggle the editor content as per push button action
by

Hi Paul,

I am seeing, password string is being passed to login screen dialog a character short. Whereas in username editor all the characters are being passed from username editor to login screen dialog.

I tried with trace statements, but I dint find the root cause for the missing character in password string. Can you please point out the mistake in this?

Reference project: password editor

by

Hello,

you have adapted the Text Editor according to the recommendations from the Ask thread Text editor information. It seems, however, that the steps 11..15 are missing or other code is implemented. I would recommend to start from scratch:

Step 1. First create a new Text Editor component.

Step 2. Adapt it according to the steps 1..15 from the above mentioned thread.

Step 3. Test it, does the Text input of special characters work as expected?

Step 4. Enhance the functionality to enable/disable the password display.

Alternative to step 4, use two different versions of the Text Editor and depending on whether the user wants to see the password or not, show/hide the corresponding version.

I hope it helps you further.

Best regards

Paul Banach

by

Hi Paul,

Thank you for the support.

I had reimplemented the password editor from scratch as suggested by you, also added the password string hide/show option and it worked as expected.

When went further to test the functionality related to login after pressing login button, i had seen that password string comparison is being failed as shown below.

Method-1:

Method-2:

Method-3:

Can you point any other way to compare these strings?

by

From your screen shot I see an additional character in the string:

Use the integrated debugger to evaluate what sign is it. Set breakpoint in line 7. Then using the Variables and Callstack windows inspect the content of the string. 

by
Hi Paul,

Thank you,

I must have made that observation, it's quite silly. Apologies on that

 A space is observed in my default string of username editor. After removing that, its working as expected.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...