# IgnitionSDK TouchscreenMouseListener does not hide password when listening to TouchscreenPasswordField

**URL:** <https://forum.inductiveautomation.com/t/ignitionsdk-touchscreenmouselistener-does-not-hide-password-when-listening-to-touchscreenpasswordfield/15570>\
**Category:** Module Development\
**Created:** [October 4, 2017, 7:07pm UTC](https://forum.inductiveautomation.com/t/ignitionsdk-touchscreenmouselistener-does-not-hide-password-when-listening-to-touchscreenpasswordfield/15570 "2017-10-04T19:07:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![garrooo](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@garrooo](https://forum.inductiveautomation.com/u/garrooo)\
**Post date:** [October 4, 2017, 7:07pm UTC](https://forum.inductiveautomation.com/t/ignitionsdk-touchscreenmouselistener-does-not-hide-password-when-listening-to-touchscreenpasswordfield/15570/1 "2017-10-04T19:07:54Z")

</div>

IgnitionSDK TouchscreenMouseListener does not hide password when listening to TouchscreenPasswordField.

Symptoms:

- When TouchscreenMouseListener is attached to a TouchscreenPasswordField component, the on-screen keyboard is rendered. However, the password is displayed in clear text on the on-screen keyboard UI.
- After pressing enter on the on-screen keyboard, the password is properly masked within the TouchscreenPasswordField.
- See screenshots attached.

Expected result:

- Password is masked on the on-screen keyboard before pressing enter.

Below is an excerpt from our custom IgnitionSDK module. Please comment if we are missing some lines or using the API incorrectly.

import com.inductiveautomation.vision.api.client.components.touchscreen.TouchscreenMouseListener;  
import com.inductiveautomation.vision.api.client.components.touchscreen.TouchscreenPasswordField;

private TouchscreenPasswordField txtPassword = new TouchscreenPasswordField();  
txtPasswordTouchListener = new TouchscreenMouseListener(txtPassword);  
txtPassword.setTouchscreenMode(TouchscreenMouseListener.MODE\_SINGLE\_CLICK);  
txtPassword.addMouseListener(txtPasswordTouchListener);

TouchscreenPasswordField.getTouchscreenStyle() natively returns com.inductiveautomation.factorypmi.application.components.util.TouchscreenMouseListener.KeyboardStyle.Auto

Note, this is a different KeyboardStyle than com.inductiveautomation.vision.api.client.components.touchscreen.KeyboardRequester.KeyboardStyle.Password

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/f718016d248ed60562bd570a81e80acd4638c578.png) ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d6021b70aa4bb25d79097fe620f67fc436a28ec8.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 4, 2017, 7:15pm UTC](https://forum.inductiveautomation.com/t/ignitionsdk-touchscreenmouselistener-does-not-hide-password-when-listening-to-touchscreenpasswordfield/15570/2 "2017-10-04T19:15:30Z")

</div>

It looks like TouchScreenPasswordField is used specifically for the user management/roster management components. For a more general purpose component (which should use the password mode as expected) try [com.inductiveautomation.factorypmi.application.components.PMIPasswordField](http://files.inductiveautomation.com/sdk/javadoc/ignition79/794-beta1/com/inductiveautomation/factorypmi/application/components/PMIPasswordField.html).

---

<div class="post-metadata">

**Author:** ![garrooo](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@garrooo](https://forum.inductiveautomation.com/u/garrooo)\
**Post date:** [October 11, 2017, 6:28pm UTC](https://forum.inductiveautomation.com/t/ignitionsdk-touchscreenmouselistener-does-not-hide-password-when-listening-to-touchscreenpasswordfield/15570/3 "2017-10-11T18:28:11Z")

</div>

I’ve confirmed that PMIPasswordField works as desired.

I am now using PMIPasswordField and PMITextField.  
I no longer need to explicitly create TouchscreenMouseListener objects nor explicitly addMouseListener(…) as these are included in the PMIPasswordField and PMITextField objects.
