This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Selection Combobox 1 changes selection Combobox 2
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 12, 2009
09:20 AM
Selection Combobox 1 changes selection Combobox 2
Hi,
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'")
viewlist.Execute
Set reclist = viewlist.Fetch
' delete any existing records
While Not (reclist Is Nothing)
viewlist.Modify 6, reclist ' 6 = delete
Set reclist = viewlist.Fetch
Wend
' open and execute a view to the _UltimoInstall table
Set viewprop = Database.OpenView("SELECT * FROM `MyInstall` WHERE `"&Session.Property("DBTYPE")&"` = '1'")
viewprop.Execute
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
Wend
' clean up
viewprop.Close
viewlist.Close
' return success to MSI
PopulateComboBox = IDOK
End Function
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'")
viewlist.Execute
Set reclist = viewlist.Fetch
' delete any existing records
While Not (reclist Is Nothing)
viewlist.Modify 6, reclist ' 6 = delete
Set reclist = viewlist.Fetch
Wend
' open and execute a view to the _UltimoInstall table
Set viewprop = Database.OpenView("SELECT * FROM `MyInstall` WHERE `"&Session.Property("DBTYPE")&"` = '1'")
viewprop.Execute
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
Wend
' clean up
viewprop.Close
viewlist.Close
' return success to MSI
PopulateComboBox = IDOK
End Function
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 12, 2009
11:32 AM
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
http://msdn.microsoft.com/en-us/library/aa368037(VS.85).aspx
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.
"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
http://msdn.microsoft.com/en-us/library/aa368037(VS.85).aspx
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.
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)