cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
davidknechtges
Level 3

Dynamically set radio buttons

I have a Basic MSI project. Within it, I have a dialog that has 2 radio buttons on it. When the user selects one of the radio buttons, then hits Next, I want the subsequent dialog that comes up to set its radio buttons based on the state of the previous one's radio buttons.

So, dialog 1 has 2 radio buttons, dialog 2 has 2 other radio buttons. The user selects one of the buttons on dialog 1, clicks Next, and then dialog 2 is shown. Upon showing dialog 2, the radio buttons in dialog 2 are set to the proper value based on what was set in dialog 1.

I can't quite figure out how to set the radio buttons in dialog 2 based on dialog 1.

I should also mention that the radio button groups are associated with different properties, so I can't share the properties.

Hopefully that makes sense....

Thanks!
Labels (1)
0 Kudos
(2) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

This sort of linkage gets a bit messy, but one approach would be to use Control Events on the Next button of the first dialog. If the first dialog's radio button property indicates one way, this Control Event can set the property for the second radio button accordingly.

I call this messy because it's unclear what should happen if the user changes the radio buttons on the second dialog, clicks back, doesn't change the radio button on the first, and then clicks next. The approach as I described it will reset the second radio button each time.
0 Kudos
davidknechtges
Level 3

MichaelU wrote:
This sort of linkage gets a bit messy, but one approach would be to use Control Events on the Next button of the first dialog. If the first dialog's radio button property indicates one way, this Control Event can set the property for the second radio button accordingly.

I call this messy because it's unclear what should happen if the user changes the radio buttons on the second dialog, clicks back, doesn't change the radio button on the first, and then clicks next. The approach as I described it will reset the second radio button each time.


Thanks! I actually solved it by doing just that. I used a DoAction with an Installscript custom action on the Next button of the dialog. The Installscript custom action then sets the property for the later dialog properly. To handle the back case as you describe it, it could be done with the DoAction on the back button of the second dialog.

Like you said, kind of messy, buit it does work.
0 Kudos