Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using WiX how do I disable/enable controls based on property change?

I'm having a bit of a brain melt at the moment where I have a WiX Combobox and when I change the selection I want to disable/enable other UI controls.

  <ComboBox Property="SQLAUTHTYPE">
    <ListItem Value="WindowsAuth" Text="Windows Authentication" />
    <ListItem Value="SqlAuth" Text="SQL Authentication" />
  </ComboBox>

That is when these events are triggered ...

  MSI (c) ... PROPERTY CHANGE: Modifying SQLAUTHTYPE property. Its current value is 'WindowsAuth'. Its new value: 'SqlAuth'.
  MSI (c) ... PROPERTY CHANGE: Modifying SQLAUTHTYPE property. Its current value is 'SqlAuth'. Its new value: 'WindowsAuth'.

The following UI controls are flagged as disabled when WindowsAuth is selected and enabled when SqlAuth is selected...

  <Control Type="Edit" Width="164" Height="16" X="25" Y="149" Id="SQLAccountTextbox" Property="SQLACCOUNT"
  <Control Type="Edit" Width="164" Height="16" X="190" Y="148" Id="SQLPasswordTextbox" Property="SQLPASSWORD" Password="yes" />
like image 500
JTew Avatar asked Feb 03 '10 03:02

JTew


1 Answers

This should do it:

<Control Type="Edit" Width="164" Height="16" X="190" Y="148" Id="SQLPasswordTextbox" Property="SQLPASSWORD" Password="yes">
    <Condition Action="enable">SQLAUTHTYPE = "SqlAuth"</Condition>
    <Condition Action="disable">SQLAUTHTYPE = "WindowsAuth"</Condition>
</Control>
like image 190
Bryan Batchelder Avatar answered Sep 24 '22 05:09

Bryan Batchelder