EasyDotNet - DataForm.NET V3.4 Developer Guide
Criteria Field Properties

All properties are divided into five groups: General, Appearance, Default Value, Script and Memo, corresponding to five tabs in DataForm Field Designer.

General

  • Field Attributes
    • Field Name is an identification of field in Criteria. Each field in one Criteria has an unique ID. If the field is not an extra field, its id is the same as the field in database to which it maps.
    • Field Title gives field a friendly name. Default field title is field id. If Field Title is empty, the input control will take its position. Hint: If you do want to display a empty Field Title, enter a space in the Field Title textbox.
    • Control Type is the type of web control that presents field in eCriteria component. There are several input controls provided by Criteria component.
      • ComboBox, DropDownList, RadioButtonList or ListBox. If you choose these three list controls, a second table will show up below to populate these list controls. There are two methods to populate list control, Collection or DataSource. You can only choose one of them at a time. If you choose collection, list control is populated by adding each item to the list . If you use DataSource instead, you have to fill out DataTextField, DataValueField and SQL command. SQL command can reference other datasource by using our {!} syntax .
      • LiteralControl. HTML codes can be written in DefaultValue Property and they will be shown on the page directly.
      • CheckBox. If you'd like checkbox to be checked when eCriteria component is first loaded, put "1" in DefaultValue Property. Empty or "0" leave checkbox unchecked.

      3rd party controls can be added to DataForm.NET through Controls Manager.

    • Is Criteria indicates whether the field is a criteria or not. ONLY the field that belongs to current table can be a criteira. However, additional fields can be added to Criteira form for other purposes. By default, this check box will be checked if the field belongs to the current datasource.
    • Tip sets the text displayed when the mouse pointer hovers over the web server control.
  • Layout
    • Visible indicates whether the field will show up in the Criteria. If visible is not checked, the control type is hidden textbox no matter what its control type is set to. This property is useful when you don't want users to change the default value of this criteria.
    • Field Order shows the display sequence of the criterias.
    • Column Span specifies how many columns input control will span.
    • Width sets the width of the current web control. By default, if Column Span is 1, then Width is 100; if Column Span is 3, then Width is 300; if Column Span is 5, then Width is 500. If Width is zero, Width property is default.
  • Database
    • Datasource Name indicates which datasource that current criteria belongs to.
    • Criteria Field indicates which field in database that current criteria maps to.
    • Operator defines how the current criteria will be used to filter the data.
    • Logic is the relationship between the current field and the other fields.
  • Auto Postback
  • AutoPostBack indicates whether an automatic postback to the server will occur whenever the user modifies the content in the control and then tabs out of the control.
  • Associated Fields is enabled when AutoPostBack is checked. Select fields in the listbox with which will be associated. When current control postbacks to server, the selected fields' value will be changed according to the current control's value. Their value will be updated according to their Default Value.
  • Validation
  • Data Type of field in database can be translated to nine data types in DataForm.NET. Nine data types are String, Numeric, Date, DateTime, Currency, Integer, Email, Credit Card and IP. DataForm.NET uses these data types to validate user inputs. More data types may be added to the list in the future.
    Note: At present, DataForm.NET does not support binary data type and BLOB data type, such as image and binary. These fields are treated as string data type, but their values are always empty. And, if you use Oracle database, User Types(such as Array Types, Object Types, Table Types and XML Schema) are not supported as well. Those fields whose data type are not supported will not show up in the DataForm.NET Designer.
  • Is Required sets whether current criteria is mandatory.

Appearance

Each field has a pair of title and input control. Each field' appearance can be customized by class in css file or style property of individual cell. You can define two class, DataFormTitle and DataFormField, in your css file. We use this css file on our demo site.

  • Title Class Name sets the title style by CSS class. Default value is CriteriaTitle.
  • Title Style sets the title style by single line of CSS.
  • Field Class Name sets the input control style by CSS class. Default value is CriteriaField.
  • Field Style sets the input control style by single line of CSS.

Default Value

  • DataSource is a source where fields' default value come from. There are four datasources(top 4) and 6 useful options(last 6). Use {***!***} syntax to get value from one of data sources. The first part, before !, means a data source, the second part, after !, means item in that data source. Check "Show help window" to help you complete the syntax.
    • Session value provides access to session-state values. For instance, if you store a value of userid in session, then that session value can be accessed by {session!userid}
    • Value from Criteria provides access to field's value from current eCriteria component. For instance, there is a field named "pub_id" in Criteria, then that field's value can be get by {criteria!pub_id}
    • Value from Request provides access to the current page request, including the request headers, cookies, client certificate, query string, and so on. For instance, a value named "pub_id" is passed to current page by querystring, then that value can be get by {request!userid}.
    • Value from CustomDatasource gives you an additional way to pass values to DataForm. You can define a custom datasource that contains values that are not within above three datasources. CustomDatasource is a NameValueCollection object and value can be get by {custom!pub_id}, where pub_id is the name of item in CustomDatasource.
    • Now returns shortdate format of today with hour, minute and second.
    • Today gives shortdate format of today. The format according to the Regional Options of server. Syntax is {today}. For instance, a field's Control Type is label and its Default Value is "Today is {today}.", the field displays "Today is 02/04/2004" (without double quotation marks).
    • Current Month returns the number of month, valid value are between 1 and 12. Syntax is {month}.
    • Current Year returns the number of year, such as 2005. Syntax is {year}.
    • Constant return a constant. Syntax is {abc} or just "abc"(without double quotation marks), abc is the constant value.
    • SQL Command returns a single value from database by a SQL command. If Default Value is a SQL Command, Datasource must be "SQL Command " at last. The SQL command can combine with SQL syntax and above DataForm syntax. For instance,a SQL command can be like "select pub_name from publishers where pub_id={dataform!pub_id}". See pub_name, city, state or country field of title DataForm.
  • Default Value is the field's value when eCriteria is created first time or re-generated if this field is associated to another field and that field postbacks to server.

Script

This group let you define client-side script (Javascript or VB script ). The script will be executed when client side events are fired on field. Multiple events can be attached to one field.
"Language", "Function" and "Register Method" are not properties of field but help you build script.

  • An Event is a notification that occurs in response to an action, such as a change in state, or as a result of the user clicking the mouse or pressing a key while viewing the document. An event handler is code, typically a function or routine written in a scripting language, that receives control when the corresponding event occurs. The ComboBox next to event textbox lists some frequently used events, more events can be entered into it.
  • Language specifies what script language you'd like to use.
  • There are two Register Methods. ClientScriptBlock method emits script just after the opening tag of the Page object's <form runat= server> element. Similar to the ClientScriptBlock method, StartupScript method emits the script just before the closing tag of the Page object's <form runat= server> element.

By clicking "Build Script" link, the skeleton of the script would be generated according to the above settings. You may add your scripts to the body of function.
Please note:

    • There is a marked line that indicates how to register function on the page and is followed by a script block. For instance, "//ClientScriptBlock#onblur#au_idONBLUR(this)", which is divided into three parts by "#", "ClientScriptBlock" means the method registering the script, "onblur" means on which event the following function will be invoked and "au_idONBLUR(this)" is the inline usage of the function, like <input name="EDataForm1:au_id" type="text" id="EDataForm1_au_id" onblur="au_idONBLUR(this)" />. The third part can be changed to any function name or combine multi functions, like "//ClientScriptBlock#onblur#au_idONBLUR(this);function1();function2()", where au_idONBLUR(this) is one of functions in the following script block and function1, function2 may be located in other script sources. When onblur is raised on au_id field, these three functions will be invoked.
      Please DONOT remove this line.
    • If the script block is not used, you can remove it. Multi-events can be attached to one field by clicking "Build Script" link each time when the event is changed.

Memo

Memo gives you a place where you can write down whatever you want.

See also
DataForm.NET Manager Overview | Integrate DataForm.NET into your application | Configuration | DataForm properties | Add Field | Add Extra Field |Delete Field | Samples
Syntax based on .NET Framework version 1.1/2.0.

Send feedback to EasyDotNet
© 2002-2007 EasyDotNet Corporation. All rights reserved.