frankjin
Posts: 18
Joined: Tue Nov 23, 2010 11:11 pm

set checkbox value based on combobox selection

Hi,

I have a combobox and checkbox on a dialog screen, I want to tick the checkbox based on the selection of a combobox value. Is this possible? if yes, How do I do this?
Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: set checkbox value based on combobox selection

Hello,

Indeed, you can tick a checkbox control based on the selection of a combobox value.
In order to achieve that you can add a Set installer property value - published event on the Combo Box control which will be executed based on the user choice.

In the Event Options you can have something like that:
  • Property: CHECK_BOX_PROPERTY
    Argument: checked
    Condition: COMBO_BOX_SELECTION = "value1"
Also, you may want to uncheck the check box control if the user select another value. In order to achieve that you can add another Set installer property value - published event. In the Event Options you can have something like that:
  • Property: CHECK_BOX_PROPERTY
    Argument: {}
    Condition: COMBO_BOX_SELECTION = "value2"
If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
frankjin
Posts: 18
Joined: Tue Nov 23, 2010 11:11 pm

Re: set checkbox value based on combobox selection

Hi Dan,

Thanks for your reply. When I go to published event for the combo box control, all the buttons (i.e. "New") are greyed out.

Our Advance Installer version is: 8.1.1 build 34572

Can you please confirm if published event is available for a combo box in this version? or we have to install a newer version?
Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: set checkbox value based on combobox selection

Hello,

I'm afraid that Published events support for ListBox, ListView, CheckList and ComboBox controls are available starting with the 10.1 version of Advanced Installer. Here are the Advanced Installer Release 10.1 Notes. Because the Maintenance Plan has expired, you can renew anytime and have access to application updates (both major and minor).

Please let us know if you have other questions.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
iranlondon
Posts: 21
Joined: Wed Mar 13, 2019 3:13 pm

Re: set checkbox value based on combobox selection

hi
i use version 15.3 and i add the two published event to my checkboc but the checkbox do not unchecked.
let me clarify:
i have two check box in a dialog and i wantif first checkbox unchecked the second checkbox become disable and unchecked.
i the checkbox diable by contron condion but not uncheck. could you please help me?
thanks in advanced
Catalin
Posts: 6597
Joined: Wed Jun 13, 2018 7:49 am

Re: set checkbox value based on combobox selection

Hello and welcome to our forums,

For this, you can use a "Radio button" control. To do this, you need to add the "Radio Button Group" control to one of your dialogs. By default, when a radio button is checked, the other one will be unchecked (the user can only choose one out of 2, 3, or more radio buttons).

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
iranlondon
Posts: 21
Joined: Wed Mar 13, 2019 3:13 pm

Re: set checkbox value based on combobox selection

thanks for your reply,
but you mean that impossible implement with check boxes?
Catalin
Posts: 6597
Joined: Wed Jun 13, 2018 7:49 am

Re: set checkbox value based on combobox selection

Hello,

That is possible with checkboxes as well. In order to achieve that, you can use the "Control Conditions" tab. Let's consider the following example:

- you have two checkboxes with the following properties: CHECKBOX_1_PROP and CHECKBOX_2_PROP

- now please go to the dialog containing your checkboxes, click on the checkbox control and, under the "Control Conditions" tab, please create the following conditions:

for the first checkbox:

Condition: CHECKBOX_2_PROP = "CheckBox"
Action: Disable

Condition: CHECKBOX_2_PROP = ""
Action: Enable


for the second checkbox:

Condition: CHECKBOX_1_PROP = "CheckBox"
Action: Disable

Condition: CHECKBOX_1_PROP = ""
Action: Enable


This way, when your user will choose one checkbox, the other one will become unavailable. When the user unchecks the checkbox, the another checkbox will become available so he can choose it.

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
iranlondon
Posts: 21
Joined: Wed Mar 13, 2019 3:13 pm

Re: set checkbox value based on combobox selection

hi
thanks for reply
i can enable or disable checkboxes
but my question is when the checkbox become disable i wanna uncheck it.
could you please tell me how to achieve this?
Catalin
Posts: 6597
Joined: Wed Jun 13, 2018 7:49 am

Re: set checkbox value based on combobox selection

Hello,

By following the steps I have given you above, once you check a checkbox, the other one becomes disabled, which means you can no longer check it. For example, if you have two checkboxes: say A and B:

- if you check A --> B becomes disabled (you can no longer check it)
- if you uncheck A --> B becomes enabled --> if you check B --> A becomes disabled

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
iranlondon
Posts: 21
Joined: Wed Mar 13, 2019 3:13 pm

Re: set checkbox value based on combobox selection

hi
thanks for reply.
i know that when check box disable the user can't change it's status,
'but if in your example if user checked Band then checked A, the B checkbox become disable
but status of B is checked that is not very good in UI feedback to user.
if you have working solution for this i appreciate your solution.
thanks
Catalin
Posts: 6597
Joined: Wed Jun 13, 2018 7:49 am

Re: set checkbox value based on combobox selection

Hello,

First of all, you should make sure that both of your CheckBoxes have their "Selected" attribute set to "False" ("Dialogs" page --> your dialog --> click on your "CheckBox" --> on the right pane, under "Value" --> the "Selected" attribute).

Please have a look on the following .aip file in which I have implemented this, for your reference:
Iranlondon - Sample project CheckBox.aip
(15.25 KiB) Downloaded 222 times
Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”