Discussion:
[WiX-users] How to check if a edit control is empty?
Daniel Janz
2008-01-30 13:02:16 UTC
Permalink
Hi,



I currently try to check if a Edit-Control is empty (has no text), I
already found the MaskedEdit-Control but I think it doesn't meet my
requirements. If I understood this control right, I would have to define
a mask with fixed length. But I need the control to validate if a server
name was filled in and only want to check if the control was left empty
to display an error message.

Is this possible in a simple way? I already tried to check the property: <Publish Event="SpawnDialog" Value="WrongTextInputDialog">DBNAME <>(&lt;&gt;) ""</Publish>

But it doesn't work like expected.



Would be grateful for any help.
Daniel Janz
2008-01-30 13:07:28 UTC
Permalink
Ok, my mistake:

<Publish Event="SpawnDialog" Value="WrongTextInputDialog">DBNAME =
""</Publish>

<Publish Event="NewDialog" Value="VerifyReadyDialog">PASSWORD =
CONFIRM_PASSWORD AND DBNAME &lt;&gt; ""</Publish>



This fixes the Problem ;-)



From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Daniel
Janz
Sent: Mittwoch, 30. Januar 2008 14:02
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] How to check if a edit control is empty?



Hi,



I currently try to check if a Edit-Control is empty (has no text), I
already found the MaskedEdit-Control but I think it doesn't meet my
requirements. If I understood this control right, I would have to define
a mask with fixed length. But I need the control to validate if a server
name was filled in and only want to check if the control was left empty
to display an error message.

Is this possible in a simple way? I already tried to check the property: <Publish Event="SpawnDialog" Value="WrongTextInputDialog">DBNAME <>(&lt;&gt;) ""</Publish>

But it doesn't work like expected.



Would be grateful for any help.
Daniel Janz
2008-01-30 14:36:26 UTC
Permalink
I've just found a other problem which I'm currently not able to solve,
how can I express the following conditions using Wix?:

(C# "Pseudo"-code)



//This variable indicates whether we should show the next
window or not

bool ShowNextWindow = false;



//First check the essential controls which we need in every
case

if (MyServerNameTextBox.Text != "" && MyDbNameTextBox.Text !=
"")

{

//If the essential part succeeded we look if the user wants
to use SQL-Authentication

if (UseSQLAuthentication == true)

{

//If the user wants to use SQL-Auth he has to provide a
username

if (MyUserNameTextBox.Text != "")

{

ShowNextWindow = true;

}

else

{

ShowNextWindow = false;

}

}

else

{

//If the user uses the alternative authentication we
don't need a username

ShowNextWindow = true;

}

}

else

{

//If the essential checks failed we don't display the next
window

ShowNextWindow = false;

}



if (ShowNextWindow == true)

{

ShowNextWindow();

}

else

{

DisplayErrorMessage();

}



The whole thing should later do it's work in a Button's <Publish> tag
condition.



Thanks in advance

Daniel



From: Daniel Janz
Sent: Mittwoch, 30. Januar 2008 14:07
To: Daniel Janz; wix-***@lists.sourceforge.net
Subject: RE: [WiX-users] How to check if a edit control is empty?



Ok, my mistake:

<Publish Event="SpawnDialog" Value="WrongTextInputDialog">DBNAME =
""</Publish>

<Publish Event="NewDialog" Value="VerifyReadyDialog">PASSWORD =
CONFIRM_PASSWORD AND DBNAME &lt;&gt; ""</Publish>



This fixes the Problem ;-)



From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Daniel
Janz
Sent: Mittwoch, 30. Januar 2008 14:02
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] How to check if a edit control is empty?



Hi,



I currently try to check if a Edit-Control is empty (has no text), I
already found the MaskedEdit-Control but I think it doesn't meet my
requirements. If I understood this control right, I would have to define
a mask with fixed length. But I need the control to validate if a server
name was filled in and only want to check if the control was left empty
to display an error message.

Is this possible in a simple way? I already tried to check the property: <Publish Event="SpawnDialog" Value="WrongTextInputDialog">DBNAME <>(&lt;&gt;) ""</Publish>

But it doesn't work like expected.



Would be grateful for any help.
Sebastian Brand
2008-01-30 15:11:27 UTC
Permalink
I think you can cascade Conditions logically.

Assuming you already have a checkbox or something tied to a property
USESQLAUTH:

<Publish Event="NewDialog" Value="NextDialog">SERVERNAME <> "" AND
DBNAME <> "" AND ((USESQLAUTH = 1 AND USERNAME <> "") OR USESQLAUTH =
"")</Publish>

<Publish Event="SpawnDialog" Value="ErrorDlg">NOT (SERVERNAME <> ""
AND DBNAME <> "" AND ((USESQLAUTH = 1 AND USERNAME <> "") OR
USESQLAUTH = "")</Publish>

Best regards,
Sebastian Brand

Instyler Software - http://www.instyler.com
I’ve just found a other problem which I’m currently not able to
(C# “Pseudo”-code)
//This variable indicates whether we should show the next
window or not
bool ShowNextWindow = false;
//First check the essential controls which we need in every
case
if (MyServerNameTextBox.Text != "" && MyDbNameTextBox.Text !
= "")
{
//If the essential part succeeded we look if the user
wants to use SQL-Authentication
if (UseSQLAuthentication == true)
{
//If the user wants to use SQL-Auth he has to provide
a username
if (MyUserNameTextBox.Text != "")
{
ShowNextWindow = true;
}
else
{
ShowNextWindow = false;
}
}
else
{
//If the user uses the alternative authentication we
don't need a username
ShowNextWindow = true;
}
}
else
{
//If the essential checks failed we don't display the
next window
ShowNextWindow = false;
}
if (ShowNextWindow == true)
{
ShowNextWindow();
}
else
{
DisplayErrorMessage();
}
The whole thing should later do it’s work in a Button’s <Publish>
tag condition.
Thanks in advance
Daniel
From: Daniel Janz
Sent: Mittwoch, 30. Januar 2008 14:07
Subject: RE: [WiX-users] How to check if a edit control is empty?
<Publish Event="SpawnDialog" Value="WrongTextInputDialog">DBNAME =
""</Publish>
<Publish Event="NewDialog" Value="VerifyReadyDialog">PASSWORD =
This fixes the Problem ;-)
] On Behalf Of Daniel Janz
Sent: Mittwoch, 30. Januar 2008 14:02
Subject: [WiX-users] How to check if a edit control is empty?
Hi,
I currently try to check if a Edit-Control is empty (has no text), I
already found the MaskedEdit-Control but I think it doesn’t meet my
requirements. If I understood this control right, I would have to
define a mask with fixed length. But I need the control to validate
if a server name was filled in and only want to check if the control
was left empty to display an error message.
Is this possible in a simple way? I already tried to check the
But it doesn’t work like expected.
Would be grateful for any help.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Richard
2008-01-30 14:56:35 UTC
Permalink
Post by Daniel Janz
But it doesn't work like expected.
In what way doesn't it work as expected?
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://www.xmission.com/~legalize/book/download/index.html>

Legalize Adulthood! <http://blogs.xmission.com/legalize/>
Daniel Janz
2008-01-30 15:19:11 UTC
Permalink
I already answered this question myself, but thx for help ;-)
<Publish Event="SpawnDialog" Value="WrongTextInputDialog">DBNAME =
""</Publish>
<Publish Event="NewDialog" Value="VerifyReadyDialog">PASSWORD =
CONFIRM_PASSWORD AND DBNAME &lt;&gt; ""</Publish>

This fixes the Problem ;-) <<

-----Original Message-----
From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Richard
Sent: Mittwoch, 30. Januar 2008 15:57
To: WiX Users
Subject: Re: [WiX-users] How to check if a edit control is empty?
Post by Daniel Janz
Is this possible in a simple way? I already tried to check the
But it doesn't work like expected.
In what way doesn't it work as expected?
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for
download
<http://www.xmission.com/~legalize/book/download/index.html>

Legalize Adulthood! <http://blogs.xmission.com/legalize/>

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Daniel Janz
2008-01-30 15:21:42 UTC
Permalink
I already tried a similar approach but failed. I will simply try it
again with your code and reply to you.

Thx for help!

-----Original Message-----
From: Sebastian Brand [mailto:***@instyler.com]
Sent: Mittwoch, 30. Januar 2008 16:11
To: Daniel Janz
Cc: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] How to check if a edit control is empty?

I think you can cascade Conditions logically.

Assuming you already have a checkbox or something tied to a property
USESQLAUTH:

<Publish Event="NewDialog" Value="NextDialog">SERVERNAME <> "" AND
DBNAME <> "" AND ((USESQLAUTH = 1 AND USERNAME <> "") OR USESQLAUTH =
"")</Publish>

<Publish Event="SpawnDialog" Value="ErrorDlg">NOT (SERVERNAME <> ""
AND DBNAME <> "" AND ((USESQLAUTH = 1 AND USERNAME <> "") OR
USESQLAUTH = "")</Publish>

Best regards,
Sebastian Brand

Instyler Software - http://www.instyler.com
Post by Daniel Janz
I've just found a other problem which I'm currently not able to
(C# "Pseudo"-code)
//This variable indicates whether we should show the next
window or not
bool ShowNextWindow = false;
//First check the essential controls which we need in every
case
if (MyServerNameTextBox.Text != "" && MyDbNameTextBox.Text !
= "")
{
//If the essential part succeeded we look if the user
wants to use SQL-Authentication
if (UseSQLAuthentication == true)
{
//If the user wants to use SQL-Auth he has to provide
a username
if (MyUserNameTextBox.Text != "")
{
ShowNextWindow = true;
}
else
{
ShowNextWindow = false;
}
}
else
{
//If the user uses the alternative authentication we
don't need a username
ShowNextWindow = true;
}
}
else
{
//If the essential checks failed we don't display the
next window
ShowNextWindow = false;
}
if (ShowNextWindow == true)
{
ShowNextWindow();
}
else
{
DisplayErrorMessage();
}
The whole thing should later do it's work in a Button's <Publish>
tag condition.
Thanks in advance
Daniel
From: Daniel Janz
Sent: Mittwoch, 30. Januar 2008 14:07
Subject: RE: [WiX-users] How to check if a edit control is empty?
<Publish Event="SpawnDialog" Value="WrongTextInputDialog">DBNAME =
""</Publish>
<Publish Event="NewDialog" Value="VerifyReadyDialog">PASSWORD =
This fixes the Problem ;-)
] On Behalf Of Daniel Janz
Sent: Mittwoch, 30. Januar 2008 14:02
Subject: [WiX-users] How to check if a edit control is empty?
Hi,
I currently try to check if a Edit-Control is empty (has no text), I
already found the MaskedEdit-Control but I think it doesn't meet my
requirements. If I understood this control right, I would have to
define a mask with fixed length. But I need the control to validate
if a server name was filled in and only want to check if the control
was left empty to display an error message.
Is this possible in a simple way? I already tried to check the
But it doesn't work like expected.
Would be grateful for any help.
------------------------------------------------------------------------
-
Post by Daniel Janz
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_________________
Loading...