dlenis
Posts: 40
Joined: Wed Nov 02, 2016 2:37 pm

Clear text box if value changes in another text box

Wed Jan 25, 2017 3:24 am

Is there a way to clear text boxes if there is text change in another text box? I can clear text boxes if there is a selected value change in a combo box or if a check box state changes by using their publish events and calling a custom action. Text boxes do not have publish events so the same method will not work.

See image, the 2 highlighted fields need to be clear if any text change in the username or password fields.

Thank you,

Diego

Dlg.png
Dlg.png (28.86KiB)Viewed 6906 times

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Clear text box if value changes in another text box

Wed Jan 25, 2017 10:06 am

Hello,

Unfortunately this is not possible.

As a workaround, instead of the highlighted fields you can output your "Test SQL Connection" result using a "Display message box" action. Just go to "Custom Actions" page and add a "Display message box" action without sequence. Then on the [Test SQL Connection] button add a published event like this:

Code: Select all

Execute action -> DisplayMessageBox
If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

jdshkolnik
Posts: 14
Joined: Tue Mar 22, 2016 3:40 pm
Contact:  Website

Re: Clear text box if value changes in another text box

Thu Jan 26, 2017 9:51 pm

Is there a reason text boxes can't raise events? Are you planning to add support for it?
John D. Shkolnik
Senior Manager
Financial Technology
Deloitte & Touche LLP

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Clear text box if value changes in another text box

Mon Jan 30, 2017 10:02 am

Hello,
Is there a reason text boxes can't raise events?
This is the Windows Installer design.
Are you planning to add support for it?
I'm afraid there are not immediate plans into this direction. Thank you for your understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Re: Clear text box if value changes in another text box

Wed Nov 16, 2022 11:03 am

Daniel wrote:
Mon Jan 30, 2017 10:02 am
Hello,
Is there a reason text boxes can't raise events?
This is the Windows Installer design.
Are you planning to add support for it?
I'm afraid there are not immediate plans into this direction. Thank you for your understanding.

All the best,
Daniel
Hi there,

I am looking for that exact same functionality. I want to execute an action as soon as the text in a textbox was changed. Was this implemented since then?

Alternatively, a property-changed event would also achieve the same outcome - in case the textbox event was not implemented since then, is this functionality available?

All the best,
Johannes

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Clear text box if value changes in another text box

Thu Nov 17, 2022 4:43 pm

Hello Johannes,

I'm afraid not.

What you could try, however, is schedule the custom action that you want to be executed on the "Next" button of the dialog where the "Textbox" control is placed.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Re: Clear text box if value changes in another text box

Thu Nov 17, 2022 5:20 pm

Hello Catalin,

Thanks for the reply.
Catalin wrote:
Thu Nov 17, 2022 4:43 pm
What you could try, however, is schedule the custom action that you want to be executed on the "Next" button of the dialog where the "Textbox" control is placed.
I already tried that before. But that was not enough for my specific scenario unfortunately. I'll try to explain my usecase:

I have a dialog with two textboxes: Username / Password and two buttons: Test Connection / Next.
At the beginning, the Next-button is disabled. I let the user fill in the Username / Password-textboxes for the ODBC connection and then the user can test the connection using the Test Connection-button. As soon as the Test Connection-button is pressed, a 'Fail' or 'Success' is indicated via showing an icon and if 'Success' is shown then also the Next-button is enabled. Now the user is able to change the Username / Password again, and that would be the trigger for me to resetting the (Fail/Success) state and disabling the Next-button again.

To do so, I optimally would be able to either have:
1. An event that is triggered upon entering text in the textbox
2. An event that is trigger upon the change of a Property (in my case the textbox's Property)
3. An event that is triggered upon changing focus/selection on the UI

I can only think of worse solutions from a UX point of view if I don't have access to one of those three features.

Do you have any suggestions on how I can achieve my desired behavior?

Best regards,
Johannes

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Clear text box if value changes in another text box

Fri Nov 18, 2022 2:26 pm

Hello Johannes,
2. An event that is trigger upon the change of a Property (in my case the textbox's Property)
I am thinking that perhaps here, when the user pressed the "Test" button, we save the value of the two textboxes in another property.

Then, we can create a "Control Condition" for the "Next" button if the adiacent property != the property of the textbox - meaning that the user has input another value or modified the current one.

To be fully honest with you, I have not tested this and therefore am not sure whether it will work or not. Most likely, you will need the "Enhanced User Interface" option enabled in the "Themes" page --> "Settings" tab for this to work, as the Windows Installer for sure does not support such scenario.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”