How do I get a value in a text box in a custom Wix dialog?

I have a Wix dialog with type editing control (which is the uri of the server the service depends on).

How to disable the "Next" button until a value is entered?

+8
wix
source share
2 answers

Here is an excerpt from some (old) production code that we used to use:

<Dialog Id="MyDlg_Error" Width="260" Height="85" NoMinimize="yes" Title="!(loc.MyDlg_Title)"> <Control Id="MyDlgSkipDesc" Type="Text" Width="194" X="48" Y="15" Height="30" Text="!(loc.MyDlg_ErrorMsg)" /> <Control Id="Ok" Type="PushButton" X="97" Y="57" Width="66" Height="17" Text="!(loc.WixUIOK)" /> </Dialog> <Publish Dialog="MyDlg" Control="Next" Event="SpawnDialog" Value="MyDlg_Error"><![CDATA[Not (MY_REQUIRED_FIELD <> "")]]></Publish> <Publish Dialog="MyDlg_Error" Control="Ok" Event="EndDialog" Value="Return">1</Publish> 
+10
source share

There is no reasonable way to do this. Instead, leave Next turned on and check with the SpawnDialog control event associated with Next, which shows an error if the property is empty. It also allows you to run a custom validation action if you want something more useful that is "not empty."

+3
source share

All Articles