Hide Radio Button based on a condition - Advanced Installer Community
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Hide Radio Button based on a condition

Hi,

I have a custom dialog which contains a Radio Group. This radio group has 4 radio buttons inside it.
What I want is, to hide one of the radio buttons if the installer is running on a 32-bit machine.

I did not find any "Control Conditions" tab for them, so how can I implement this?

Thank you.
Prerak
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Hide Radio Button based on a condition

Hi Prerak,

I'm afraid that radio button does not support a control condition, only the whole group supports such conditions. So, in order to achieve what you want, you can use two different "Radio Button Group" controls as explained in the "Hide or disable "Custom" radio button" thread and use the "VersionNT64" property to display them depending on the machine bitness.

Let me know if this helped, otherwise give me more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Hide Radio Button based on a condition

Hi Eusebiu,

I already had a look with on the approach that you suggested.
The issue with that is, on a 64-bit machine, both the radio groups will be visible and the user can select one option each from both of them but I don't want that. I want that only one radio button should be selected.
Also, my custom actions depend on the value of the radio group, so in case of two radio groups, I'll have to make duplicate custom actions with different execution conditions.

Let me know if there is any other way around for this.

Thank you.
Prerak
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Hide Radio Button based on a condition

Hi Prerak,
The issue with that is, on a 64-bit machine, both the radio groups will be visible and the user can select one option each from both of them but I don't want that.
This may happen if you did not set the appropriate control condition for both radio button groups. For example, if you want a group not to be displayed on the 64-bit machine, you can use the following condition:

Code: Select all

NOT VersionNT64
Also, my custom actions depend on the value of the radio group, so in case of two radio groups, I'll have to make duplicate custom actions with different execution conditions.
No, it is not necessary to duplicate your custom action, but you can use the appropriate condition for it as in the example below:

Code: Select all

(VersionNT64 AND RADIOBUTTONGROUP1 = "value1") OR (NOT VersionNT64 AND RADIOBUTTONGROUP2 = "value1")
Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Hide Radio Button based on a condition

Hi,
This may happen if you did not set the appropriate control condition for both radio button groups. For example, if you want a group not to be displayed on the 64-bit machine, you can use the following condition:

Code: Select all

NOT VersionNT64
Yeah I understand that. This will hide the radio group for a particular condition. I''ll explain my scenario in a bit detail.

Currently there are 4 radio buttons in a radio group. The first 3 should be always displayed (no condition for them) and the last one should be displayed on only 32-bit machines.
So as per the approach suggested,I create two radio groups such that,
- Radio Group 1 = Radio button 1, Radio button 2, Radio button 3
- Radio Group 2 = Radio button 4

I can hide Radio group 2 for 32-bit machine but for 64-bit machine user can select Radio button 1 and Radio button 4 as both belong to different Radio groups. I don't want that.

I hope you got my scenario.

Let me know if you need more details.

Prerak
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Hide Radio Button based on a condition

Hi Prerak,

I understand your scenario, but your approach will, indeed, behave as you described. The solution described in the thread I mentioned, which you should also implement, is to create two radio button groups as follows and display them conditionally (one on the 32-bit machines and the other on the 64-bit machines):
  • - Radio Group 1 = Radio button 1, Radio button 2, Radio button 3
    - Radio Group 2 = Radio button 1, Radio button 2, Radio button 3, Radio button 4
Let me know if this helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Hide Radio Button based on a condition

Hi Eusebiu,

It didn't strike me to create two radio groups with all the required buttons in them for both scenarios.
Thank you for the idea. It solved my issue.

Regards,
Prerak
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Hide Radio Button based on a condition

You're welcome Prerak. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”