Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 4

Selection Combobox 1 changes selection Combobox 2


On a dialog I have 2 comboboxes. When the user changes the value of combobox 1, the values have to be changed in combobox 2.

I have a script to change the values in the table. See below.
But how do i refresh the currentpage with its values?

I tried with two exact the same dialogs but when i do a doaction on the combobox the install exits with an error.

Anyone can help me with this?

Const msiViewModifyInsertTemporary = 7
Const IDOK = 1

Function PopulateComboBox( )
' open and execute a view to the ComboBox table
Set viewlist = Database.OpenView("SELECT * FROM `ComboBox` WHERE `Property`='INSTALLTYPE'")

Set reclist = viewlist.Fetch

' delete any existing records
While Not (reclist Is Nothing)
viewlist.Modify 6, reclist ' 6 = delete
Set reclist = viewlist.Fetch

' open and execute a view to the _UltimoInstall table
Set viewprop = Database.OpenView("SELECT * FROM `MyInstall` WHERE `"&Session.Property("DBTYPE")&"` = '1'")

Set recprop = viewprop.Fetch

r = 0
While Not (recprop Is Nothing)
' ListBox record fields are Property, Order, Value, Text
Set recnewlist = Installer.CreateRecord(4)

r = r + 1
recnewlist.StringData(1) = "INSTALLTYPE"
recnewlist.IntegerData(2) = r
recnewlist.StringData(3) = recprop.StringData(1)
recnewlist.StringData(4) = recprop.StringData(2)

' insert the temporary ListBox record
viewlist.Modify msiViewModifyInsertTemporary, recnewlist

' fetch the next Property record
Set recprop = viewprop.Fetch

' clean up

' return success to MSI
PopulateComboBox = IDOK
End Function
Labels (1)
0 Kudos
(1) Reply
Level 7

I believe that you are running into a limitation of Windows Installer user interface. According to the ControlEvent table doc it isn't possible to perform any actions from a ComboBox control:

"On Windows XP or earlier operating systems, users can publish a control event only by interacting with a Checkbox Control or Pushbutton Control. With Windows Server 2003, users can publish a control event only by interacting with a Checkbox Control, SelectionTree Control, and Pushbutton Control. Listing other controls in the Control_ field has no effect."

ControlEvent Table

One workaround option is to create a PushButton control and label it something like 'Refresh'. Then when the user clicks on the Refresh button you can have a NewDialog event to go to the cloned dialog which will have the refreshed ComboBox controls.

Hope this helps.
0 Kudos