[wix-users] Check a Checkbox control based on two other checkboxes

James Buchan James.Buchan at servelechsc.com
Thu Feb 8 09:38:16 PST 2018


Your problem is that you do a cascade from the 'All' checkbox, but you don't have anything in place going back up the tree.

Stick this:
<Publish Property="ALLFEATURES_CHECKED" Value="AllFeatureValue" Order="2">APPFEATURE_CHECKED AND DBFEATURE_CHECKED</Publish>
Into your ControlAppFeature and ControlDbFeature and you will get the behaviour you expect (if it works is another matter)

With only 2 checkboxes, personally, I wouldn't bother with an 'All' option. It's the difference between 1 click and 2...if I had a few more features then, yes id have a select all , but then, if I was going WiX UI only, id also look at the 'SelectionTree' control.

https://www.firegiant.com/wix/tutorial/user-interface-revisited/customizations-galore/

The "value={}" means 'delete the property'. A checkbox with a value will appear ticked even if its not the value you want it to be.

James

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Ven H via wix-users
Sent: 08 February 2018 16:46
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Ven H <venh.123 at gmail.com>
Subject: [wix-users] Check a Checkbox control based on two other checkboxes

I have a UI Dialog in which I have 3 checkboxes for installing features.
All, App and DB. I have 3 requirements
1. If All is checked, both App and DB have to be checked, 2. If App or DB is unchecked, All will be unchecked, 3. If both App and DB are checked, All will have to be checked.

I am able to achieve 1 and 2 above, but not able to achieve the 3rd case.
Can anyone please help? I have given the code below. Also, I am not able to completely understand the meaning of Value={}

<Control Id="ControlAllFeature" Type="CheckBox" X="180" Y="33" Width="140"
Height="17"
    Property="ALLFEATURES_CHECKED" CheckBoxValue="AllFeatureValue"
Text="Install Everything">
          <Publish Property="APPFEATURE_CHECKED" Value="AppFeatureValue"
Order="1">ALLFEATURES_CHECKED</Publish>
          <Publish Property="APPFEATURE_CHECKED" Value="{}" Order="2">NOT ALLFEATURES_CHECKED</Publish>
          <Publish Property="DBFEATURE_CHECKED" Value="DBFeatureValue"
Order="3">ALLFEATURES_CHECKED</Publish>
          <Publish Property="DBFEATURE_CHECKED" Value="{}" Order="4">NOT ALLFEATURES_CHECKED</Publish>
          <Publish Property="ALLFEATURES_CHECKED"
Value="AllFeatureValue">APPFEATURE_CHECKED = 1 and DBFEATURE_CHECKED = 1</Publish>
        </Control>
        <Control Id="ControlAppFeature" Type="CheckBox" X="191" Y="50"
Width="140" Height="17"
     Property="APPFEATURE_CHECKED" CheckBoxValue="AppFeatureValue"
Text="Install Application">
          <Publish Property="ALLFEATURES_CHECKED" Value="{}" Order="1">NOT APPFEATURE_CHECKED</Publish>
        </Control>
        <Control Id="ControlDBFeature" Type="CheckBox" X="191" Y="67"
Width="140" Height="17"
           Property="DBFEATURE_CHECKED" CheckBoxValue="DBFeatureValue"
Text="Install DB">
          <Publish Property="ALLFEATURES_CHECKED" Value="{}" Order="1">NOT DBFEATURE_CHECKED</Publish>
        </Control>


Regards,
Venkatesh

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list