PDA

View Full Version : [CLOSED] Example of AllowOnlyWhitespace property



osef
Jan 04, 2014, 7:52 AM
Could you please to get me an example of the AllowOnlyWhitespace property in TextField or ComboBox?

Thank you

Daniil
Jan 06, 2014, 1:48 PM
Hi @osef,

I am not sure how could look such an example.

<ext:TextField runat="server" AllowOnlyWhitespace="false" />

Here is an explanation what this property does.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.Text-cfg-allowOnlyWhitespace


Specify false to automatically trim the value before validating the whether the value is blank. Setting this to false automatically sets allowBlank (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.Text-cfg-allowBlank) to false. Defaults to: true

osef
Jan 08, 2014, 12:57 AM
Hi @osef,

I am not sure how could look such an example.

<ext:TextField runat="server" AllowOnlyWhitespace="false" />

Here is an explanation what this property does.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.Text-cfg-allowOnlyWhitespace


Daniiel I don't know as this property is implemented, In Which validation? (According to the documentation).

Daniil
Jan 08, 2014, 7:03 AM
It deals with the built-in client side validation.

Please type white space in these TextFields and notice the difference in the behavior:

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:TextField
runat="server"
AllowOnlyWhitespace="true"
LabelWidth="150"
FieldLabel="AllowOnlyWhitespace true" />

<ext:TextField
runat="server"
AllowOnlyWhitespace="false"
LabelWidth="150"
FieldLabel="AllowOnlyWhitespace false" />
</form>
</body>
</html>

osef
Jan 08, 2014, 7:25 AM
It deals with the built-in client side validation.

Please type white space in these TextFields and notice the difference in the behavior:

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:TextField
runat="server"
AllowOnlyWhitespace="true"
LabelWidth="150"
FieldLabel="AllowOnlyWhitespace true" />

<ext:TextField
runat="server"
AllowOnlyWhitespace="false"
LabelWidth="150"
FieldLabel="AllowOnlyWhitespace false" />
</form>
</body>
</html>


Thank you Daniil, With this example I understood.