Control Class
The Control Class defines the user interface properties and behaviors of a control. The control class drives the visual depiction of the control and, in conjunction with the Control Style (a CSS class), determines how the control is rendered in HTML on various netFORUM pages.
Probably 90% or more of all controls in netFORUM are based on a Column. Ultimately, when data is saved, it will go into a column in a database table. The Control Class drives how the user will see that Column expressed on a page, and the Control Class drives how the user will be able to enter data into that column and how that column will look on a page. Therefore, the Control Class is closely associated with the Data type on which the Column the control is based. For example, columns of the av_flag data type are almost always presented as a CheckBox control class.
Control Class Usage
Control Classes are applied in the following areas. Not all Control Class Types are used for all columns. For example, you could not have a Button control class for a report parameter as this would not make sense.
- Column - where the base or default Control Class is typically set. All of the control classes below can be used as the base control class for a column.
- Form Controls on the Form Designer - All of the control class types below can be used as a form control control class.
- Search Control - a search filed on a Find page. Valid control class types:
- TextBox
- TextBoxMultiLine
- CheckBox
- Label
- DropDownList
- ListBox
- RichTextBox
- DateTextBox
- Hidden
- Report Parameter - This is the page shown after a user runs a Report and inputs any run-time parameters. Valid control class types:
- TextBox
- CheckBox
- DropDownList
- ListBox
- DateTextBox
- Form Extension - Valid control class types:
- TextBox
- Button - another common use
- Label - generally used only on non-designed forms to put a label, such as on certain Toolkit pages.
- CheckBox
- DropDownList
- DropDownListAdd
- ListBox
- HtmlButton
- Div - non-visual form extensions, the most common use.
When controls associated with data column are added to a Form, netFORUM will default the Control Class based on the Control Class of the underlying Column. Although it is possible to change the Control Class of the column on a form, the designer should do so only when appropriate. For example, here are some common re-mappings of Control Classes from the original column definition to a different Control Class on a form:
Original Column Control Class | Form Control Class | Reason for Modification |
---|---|---|
TextBox | DateTextBox | Express an ordinary TextBox as a Date |
TextBox | Hidden | Keep a TextBox on the form, but hide it |
TextBox | Label | Express a TextBox as a view-only Label |
TextBox | TextBoxMultiLine | Allow user to enter longer values in a TextArea |
DropDownList | DropDownListAdd | Place Add button next to DropDown |
DropDownList | DropDownListAddEdit | Place Add and Edit button next to DropDown |
DropDownList | Hidden | Keep a DropDownList on the form, but hide it |
DateTextBox | TextBox | Remove the Calendar control from a Date field |
List of Control Classes
The available Control Classes are listed below, with additional comments where applicable. Each Control Class is based on a generic HTML input/tag but also may have additional attributes that govern the appearance or behavior of the control.
DateTextBox
An ordinary TextBox bound to a Date column can be expressed as a DateTextBox. The DateTextBox will place a Calendar control to the right of the input and will validate the user’s entry. The Column input mask should be set to "99/99/9999". This will be done automatically when the column is added into the system.
For more information about the DropDownList class, see DropDownList
DropDownListAdd
Similar to a standard DropDownList, but also places an add icon to the right of the control to enable a user to add a new value on the fly.
DropDownListAddEdit
This Control Class operates in the same way as a DropDownListAdd, although it also allows the user to edit an existing record by clicking on the Edit icon that will appear to the right of the DropDownList when an item is selected.
DropDownListAddEditQuery
In development
EmailTextBox
Used for formatting textboxes associated with email addresses. Columns with av_emaildata type should use this Control Class type.
FileTextBox
Used to specify a file to import. At run-time, a browse button will appear to the right of the control to allow the user to find the file.
Hidden
HtmlButton
HyperLink
Produces a clickable hyperlink. See html :: Hyperlink above for more information.
Image
Produces an image. See html:: Image above for more information.
Label
Produces ordinary html text, with html tags supported. See html::Free Text above for more information.
ListBox
Password
A password column can be expressed as a Password control class to automatically make the input be of type password. User entries will appear as asterisks.
RadioButtonList
Creates a Radio Button List. Options in the radio button list are set up similarly to #DropDownLists.
RichTextBox
Turning a TextBox or TextBoxMultiLine into a RichTextBox will automatically place HTML editing controls around the textarea. Be sure that the underlying column is large enough to contain HTML data. See HTMLEditor for more.
Spinner
Places a specialized netFORUM control with a textbox and an up and down arrow that allows the user to select a numeric value.
In the URL/Image Path/Data textarea, you must enter the default value, minimum value, and maximum value in a designated format:
Minimum Quantity, Maximum Quantity, Minimum Quantity Tool Tip, Maximum Quantity Tool Tip
The Quantity numbers may be parsed values.
For example:
Minimum 1, Maximum is {cld_qty}:
1, {cld_qty}
Minimum is 0, Maximum value is Available for Return: {ivd_available_for_return}:
0, {ivd_available_for_return}
Minimum is returned + cancelled, Maximum is 99999:
{ivd_minimum_quantity}, 99999
Quantity cannot be less than 0, quantity cannot be more than the available quantity:
0,{ivd_balance_quantity}
SQLTextBox
A specialized netFORUM control that places a button next to the TextBox that enables a user to write a specialized SQL Query.
A SQLTextBox is made up of three controls: a TextArea for the SQL statement, a adjoining button for Sub-Query Builder, and a third button to Validate the SQL Expression for correct syntax.
When the Sub-Query Builder button is pushed, a sub-query dialog box is displayed that will allow you to build a sub query that will populate the content of the text area when the return button is pushed on the sub-query builder window.
When the Validate button is pressed, a modal window will pop up and parse the SQL statement for correctness. If there is an error, it will be displayed.
TextBox
Used for ordinary textbox.
TextBoxMultiLine
This will render the control as an HTML TextArea.
If the control is read-only, then change the "Control Class" to "Label" and the "Control Style" to "DataFormLabelMultiLine". This will add a vertical scroll bar to make the field easier to view.
TimeTextBox
For nvarchar controls where a time must be tracked, choose this Control Class to validate the user's entry. Entries must be in one of these formats:
- 8:00 AM
- 8:00
- 12:15 PM
- 12:15
etc.
Military time cannot be used in a TimeTextBox; 14:25 must be entered as 2:25 PM. Time Zones are not entered with TimeTextBox. The most common usage of TimeTextBox is with events and sessions; the assumption is that the time is for the local time zone where the event is held.
UpdateChildForm
Specialized netFORUM control associated with the UpdateGridControl.
UpdateGridControl
Specialized netFORUM control associated with the UpdateGridControl.
UrlTextBox
For controls that will contain a URL, choose this Control Class to validate the user’s entry. Columns of the av_urlData Type default to this control class type.