How about this?

<?define InputValidated="SERVERNAME AND DATABASENAME AND
(USEINTEGRATEDSECURITY = 1 OR (DBUSERNAME AND DBPASSWORD))"?>

<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17"
Default="yes" Text="Next">
          <!-- Validate input -->
          <Publish Event="SpawnDialog" Value="IncompleteInputErrorDlg">
            NOT ($(var.InputValidated))
          </Publish>
          <Publish Event="NewDialog" Value="IISDlg">
            $(var.InputValidated)
          </Publish>
        </Control>

Yes, I realize that this maintains the double-evaluation, but it is more
maintainable (since you type it only once) and the time to evaluate
shouldn't be long compared to the time required to use the UI via mouse
and/or keyboard.

-----Original Message-----
From: pmdarrow [mailto:pdar...@metaworks.com] 
Sent: Thursday, December 31, 2009 10:34 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Input Validation


Hi all, what's the best way to validate that several required fields on a
dialog are filled in? I've done some searching on this list but haven't
found anything conclusive. Here's a snippet of a dialog that asks the user
to enter some database information:

<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17"
Default="yes" Text="Next">
          <!-- Validate input -->
          <Publish Event="SpawnDialog" Value="IncompleteInputErrorDlg">
            NOT (SERVERNAME AND DATABASENAME AND (USEINTEGRATEDSECURITY = 1
OR (DBUSERNAME AND DBPASSWORD)))
          </Publish>
          <Publish Event="NewDialog" Value="IISDlg">
            SERVERNAME AND DATABASENAME AND (USEINTEGRATEDSECURITY = 1 OR
(DBUSERNAME AND DBPASSWORD))
          </Publish>
        </Control>

This works, but I don't like repeating those two statements (albeit one
wrapped in a NOT). It seems like this is the only way I can get it to
validate every time. If I store the result of the main statement in a
property, the property doesn't get reset when going back or forward in the
wizard so therefore it only validates the input once. Any ideas?
-- 
View this message in context:
http://n2.nabble.com/Input-Validation-tp4237405p4237405.html
Sent from the wix-users mailing list archive at Nabble.com.

----------------------------------------------------------------------------
--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to