When to Use a Text Field
A text field is the default value when a new field is created. Text fields are converted to .NET strings and could contain anything.
A text field is perhaps one of the most flexible fields. Anything could be stored in text fields even dates and numeric values. Of course, if you want to use the advantages of the type casting you should use the available field types.
Configure a Text Box
In this section you will learn how to configure a text box. First you will get information about the object field settings. A second chapter describes the view field settings.
Object Field
If you create a new text object field or method field, it is possible to change some type specific properties. Of course there are also a lot of generic properties like unique, external name or default value. For more information: Common Properties
- Click on the object.
- Create a new field.
- Set type to Text.
Maximum Length
The maximum length specifies the maximum amount of characters. It should be a positive numeric value and it will be checked by the ADM as well as in the framework back-end.
The default value of this property is 0. This means that it could be any length. It is possible that the web browser overrules this setting. Some browsers do change the maximum length to 524288.
Process HTML Tags
The Process HTML Tags property determines what will happen with HTML Tags in the text area.
This property has 3 different options:
- Unchecked
- Encode
- Remove
We will use the following text as an example to show the difference between each option.
Process HTML Tags Unchecked
When the property is unchecked, HTML tags will be executed just as they would in a normal HTML file. This gives the following output.
Process HTML Tags Checked
Option Remove
When the property is set to 'Remove', HTML tags will be removed from the text. The text inside the HTML tags will still be shown. This gives following output.
Option Encode
When the property is set to 'Encode', HTML tags will be encoded. You will still be able to see the HTML tags in the text but they won't be interpreted as HTML tags so the HTML code won't be executed, instead it will be shown as plain text.
View Field
A text field is displayed in the ADM and CM by an HTML text box. Depending on the view type there are different properties.
Multi Record View
Property | Description |
---|---|
Multi Line | If checked, newline characters will be replaced by a new line. If not checked they will not be replaced. |
Comma Separated Values | If checked, the standard multi value separator ;# used by Ometa will be replaced by a comma. This is common when selecting multiple values in a field. |
Single Record View
Property | Description |
---|---|
Multi Line | If checked, newline characters will be replaced by a new line. If not checked they will not be replaced. |
Comma Separated Values | If checked, the standard multi value separator ;# used by Ometa will be replaced by a comma. This is common when selecting multiple values in a field. |
Events | JavaScript events used to interact with the text box or text area. |
Create and Update View
Property | Description |
---|---|
Read Only | If checked the control could not be changed by the user. |
Use Data Source | For more information: Working with data sources. |
Mask | Refer to rules and literals. |
Password | If checked, the characters will be masked by *. Implementation could be different depending on the browser. |
Multi Line | If unchecked, the ADM displays a textbox. If checked, the ADM displays a text area. It is possible to change the amount of rows and columns. |
WYSIWYG | If checked, multi line editor will become a WYSIWYG editor. For more information: WYSIWYG Editor |
Comma Separated Values | If checked, the standard multi value separator ;# used by Ometa will be replaced by a comma. This is common when selecting multiple values in a field. |
Events | JavaScript events used to interact with the text box or text area. |
Configure a Text Area
A text area is nothing more than a text field with the possibility to use enters.
Look, this is a text area in a create or update view:
Follow the next steps to create a text area:
- Create a text field.
- Go to the view.
- Check the Multi Line checkbox of the view field.
- (OPTIONAL) Check the WYSIWYG Editor checkbox to change the text area to a WYSIWYG Editor.
Multi line means that \n and \r characters will be replaced by a new line (in HTML a br-tag). In a create and update view you also have the possibility to specify the amount of rows and columns. If you are familiar with writing HTML you probably recognize this. Rows and cols are the number of characters that are going to fit in the text area.