We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Darion
Posts: 5
Joined: Wed Nov 27, 2019 9:51 am

Make checkboxs which can condition other checkboxes

Hi,

I am trying to make checkbox dependecies in my installer: If checkbox A is checked by the user, then checkbox B would automatically get checked regardless of its current state. While checking B doesn't triggers A.

I've searched the control events of checkbox interactions, doesn't seem to find such function. I wonder if this is possible? Thanks.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Make checkboxs which can condition other checkboxes

Hello and welcome to Advanced Installer forums,

Yes, this is achievable.

Before we start, a little explanation. Almost every UI control has a property assigned to it. In the case of a checkbox control, the property is used to store its state, as it follows:

- the property has (by default, can be changed) the "CheckBox" value if the checkbox is checked.

- the property has the "" (empty string) value if the checkbox is unchecked.

More information in the below screenshot:
checkbox.png
checkbox.png (110.26 KiB) Viewed 3399 times

Basically, in order to check a checkbox, we can set its property to the "CheckBox" value. To do so, you can go to "Dialogs" page --> your dialog --> select the checkbox on which the selection of the second checkbox depends (in our case, its checkbox_A, because we want to enable checkbox_B only if checkbox_A is checked) and, under "Published Events" add an event as it follows:

Event: Set installer property value

Property: CHECKBOX_2_PROP

Argument: CheckBox

Condition: CHECKBOX_1_PROP = "CheckBox"


The above event translates to: set the CHECKBOX_2_PROP (which is the property assigned to our checkbox_B) to "CheckBox" (check it) if CHECKBOX_1_PROP (the property assigned to checbox_A) is equal to "CheckBox" (it is checked).

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Darion
Posts: 5
Joined: Wed Nov 27, 2019 9:51 am

Re: Make checkboxs which can condition other checkboxes

EDIT:
NVM, the Argument should be {} without quotation marks. :oops:
Thanks again.


Hello Catalin,

Thank you for the detailed guide, it's working like a charm.

However, I got problem when I tried to make the complementary part of this logic, which is - when I uncheck B, A should get unchecked too. Basically means A is totally dependent on B.

Following your method, I set the Published Events of B this time:

Event: Set installer property value
Property: CHECKBOX_A_PROP
Argument: "{}"
Condition: CHECKBOX_B_PROP = ""


And it doesn't work, sometimes unchecking B even checks A. Feels like a grammar issue but I tried different condition phrases and no luck. Could you help look into it? Thank you.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Make checkboxs which can condition other checkboxes

You are always welcome.

I am glad I could help and I'm glad you got this working.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”