Set default textbox value based on Combobox value - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

kettch
Posts: 28
Joined: Wed Dec 03, 2008 9:34 pm

Set default textbox value based on Combobox value

I have a scenario where I have a ComboBox and a TextBox, both linked to separate properties. I'd like the TextBox value to change based on the value of the ComboBox, but the actual values are different. This would be extremely useful in setting a port number, i.e. ComboBox value changes to "mssql" and the TextBox value changes to "1433".

I did some searching on the forums and found this thread http://www.advancedinstaller.com/forums ... box#p25422 where Gabriel indicates that this cannot be done due to limitations with Windows Installer.

My question is, can this be done now that nearly 2 years has passed since that thread or am I still out of luck? If it's not possible, any creative ideas on how to fake this behavior would be welcome.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Set default textbox value based on Combobox value

Hello,

A dialog can be refreshed when a property is set. In Windows Installer, the only controls that can dispatch a SetProperty event are Check Boxes and Buttons. If you enable the Advanced Installer Enhanced UI from the Themes page, you can also use List Box controls for the same purpose.

If you decide to use any of the above controls to refresh your dialog, here is the tutorial that explains how.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kettch
Posts: 28
Joined: Wed Dec 03, 2008 9:34 pm

Re: Set default textbox value based on Combobox value

I followed that tutorial but am still stuck.

Using a new ListBox that I just created, I've added a published event that calls a custom action to set the property and refresh the dialog, which is exactly the same as that tutorial. The problem is nothing happens. In fact, I've added a published event that calls a custom action that displays a simple static message via MsgBox and still nothing happens...no message box.

None of the published events I've added to the ListBox appear to be executing at all. Any ideas? By the way, this is AI 8.1.3 with an Enterprise project type.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Set default textbox value based on Combobox value

Hello,

In case of a List Box control, the events get published when the user double clicks on a list item.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”