1. General information

1.1. Description of the control

TextArea is a text field of any width and height intended for entering plain text, including line breaks. The edit form saves at most 10,485,760 characters and cuts a longer text when the record is saved. When the width is set to 0 pixels, the text box is displayed as a regular paragraph without a border and cannot be edited.

1.2. Create a new control

1.3. Edit or delete a control

  • For each existing control, a pencil icon appears on the left side of the edit form to change or delete the control's settings.
  • Individual controls can be moved vertically in the edit form using the Drag&Drop method. Moving consists of grabbing the control, preferably behind its name located in the left column of the edit form, and then dragging it to the desired position in the edit form.
  • Controls can be moved only with the “Drag&Drop” check box located above the toolbar with controls selected. For security reasons, this check box is cleared after each login to the application, so that a control is not moved by accident.
  • Deleting a textarea results in the irreversible deletion of the database column associated with that textarea in the database, and thus in the deletion of its values in all records in the database table. Some textarea in system edit forms cannot be deleted because they are necessary for the basic functionality of the entire application.

2. List of tabs in the control settings dialog

  • General – Setting general properties
  • Default value – Set the default value for newly created records
  • Events – Javascript event settings
  • Button – Button settings that can be displayed to the right of the control
  • Help – Settings for help text that can be displayed on the right side of the edit form
  • Filter – Setting the filter that can be displayed in the view table in the column header
  • Rights – Rights settings
  • Administration – Setting other properties

2.1. “General” tab

2.1.1. Name

  • For all data types
  • The name of the control displayed in the edit form in a separate column with a colored background to the left of the text box itself.

2.1.2. Abbreviated name

  • For all data types
  • Optional control name displayed in the view table header if the control is selected as one of the view table columns.
  • If an abbreviated name is specified, the full name of the control is displayed in the tooltip above the abbreviated name.
  • If an abbreviated name is not specified, the full name of the control is displayed in the header of the view table.
  • The abbreviated name “ ” (fixed space) can completely hide the name of the control displayed in the view table.

2.1.3. Dictionary...

  • For all data types
  • The dictionary lists the names of other controls, forms, view pages, categories, applications, and application groups used across the entire application.
  • The dictionary search is used to design the correct control name and to maintain the consistency of the nomenclature throughout the application so that controls with the same meaning located in different places in the application are named in the same way.

2.1.4. Data type

  • The data type defines the type or meaning of the values that the control can take.
  • Textarea uses a single database column type that is associated with the current control in the database – “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.
  • For data types other than “Text string”, the CodeMirror code editor is used only when the width is not 0, the control is not hidden in user mode and the web browser is modern; otherwise a classic text box is displayed. The editor toolbar is not displayed on a mobile device or for a field that cannot be edited.
  • The drop-down list contains the following data types

Text string

  • Classic multiline text box with framing.
  • “String” of unlimited length, represented as the database type “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.

Source code

  • CodeMirror text box with numbered lines for writing general source code with syntax highlighting.
  • “String” of unlimited length, represented as the database type “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.

HTML

  • CodeMirror text box with numbered lines for writing general HTML code with color syntax highlighting.
  • “String” of unlimited length, represented as the database type “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.

XML

  • CodeMirror text box with numbered lines for writing XML code with color syntax highlighting.
  • “String” of unlimited length, represented as the database type “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.

JavaScript

  • CodeMirror text box with numbered lines for writing javascript code with color syntax highlighting.
  • “String” of unlimited length, represented as the database type “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.

C#

  • CodeMirror text box with numbered lines for writing C# source code with color syntax highlighting.
  • “String” of unlimited length, represented as the database type “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.

C++

  • CodeMirror text box with numbered lines for writing C++ source code with color syntax highlighting.
  • “String” of unlimited length, represented as the database type “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.

Wiki

  • CodeMirror text box with numbered lines for writing general Wiki code.
  • “String” of unlimited length, represented as the database type “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.

Markdown

  • CodeMirror text field with numbered lines for writing text with Markdown markup syntax.
  • “String” of unlimited length, represented as the database type “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.

JSON

  • CodeMirror text box with numbered lines for writing data in the JSON format with color syntax highlighting.
  • “String” of unlimited length, represented as the database type “blob sub_type 1” for the Firebird database and “nvarchar(max)” for the MSSQL database.

2.1.5. Width

  • For all data types
  • The width of the control, expressed in pixels.
  • The width consists of two parts, the width of the control itself in the edit form, and optionally the width of the column in the view table if the control is selected as one of the columns in the view table.
  • When the width is set to 0 pixels, the text box is displayed as a regular paragraph without a border and cannot be edited. The value is output as HTML from which unsafe tags are removed first.

2.1.6. Rows

  • For all data types
  • The number of lines determines the optional height of the text box in the edit form.
  • The default number of rows is 5. The minimum number of rows is 1, the maximum is 250.

2.1.7. Options

  • Required field
  • For all data types
    • Checking the required field determines whether the edit form should be required to fill in a valid value before saving it to the database.
    • The required field setting does not affect the database type of the column that is associated with the current control in the database. All database columns are set to accept the database value “null”.
    • The value can be stored in the database as a non-zero-length text string, a zero-length text string (empty string), or as a “null” database value. When compiling the conditions of a database query, it is therefore important to take into account the alternative that in addition to a zero-length text string, the database value “null” is also stored in a column in the database table. Such a condition may look like this in NG speech: ta equals “” or ta is not defined. And now in SQL: ng_ta = '' OR ng_ta IS NULL.
  • Read-only
  • For all data types
    • The read-only control setting determines whether the text box should be disabled in the edit form.
    • Values cannot be entered manually in a disabled field, the text box itself has a gray background, and the text of the value in that field is displayed in a different font than the rest of the controls.
    • It is possible to fill in the values in the disabled field using javascript:
      • control_SetValue(#ng_#, 'abc');
      • ta_Insert(#ng_#, 'abc');
    • For the default value types “Current user”, “Current date”, “Current time”, “Current date and time” and “Current value in the database”, the value of a read-only control is protected on the server as if “Disable value assignment using JavaScript” were checked – the server does not accept a value changed by JavaScript when the record is saved.
    • Controls can generally be disabled using javascript:
      • control_Disable(#ng_#); // General javascript function for all database controls
      • ta_Disable(#ng_#);
    • It is also possible to enable controls using javascript:
      • control_Enable(#ng_#); // General javascript function for all database controls
      • ta_Enable(#ng_#);
    • By default, it is not possible to enable a control that is set to read-only; the javascript function control_Enable must be passed the second optional parameter “ignorereadonly”: control_Enable(#ng_#, true);
  • Disable value assignment using JavaScript
  • For all data types in conjunction with the “Read-only” option
    • Checking the value change ban using javascript will ensure that read-only controls are not spoofed by the value in the web browser by potential attackers on the edit form.
    • Before saving the record to the database, it is always checked whether the value has been changed only on the server side, and if necessary sets the value to the original valid one.
  • Hidden field
  • For all data types
    • The hidden field setting determines whether the control should be part of an edit form, but should not be visible in user mode.
    • The hidden control, including the filled value, can be found in the source code of the web page. It cannot therefore be used as part of security measures, the rights to the control are used for this.
  • Show as a link in the view table to open the record on the new tab
    • Checking this box determines whether the control values should be displayed everywhere in the application as a link to open the record on a new tab.
  • Allow multiple assignments
  • For data type: Text string
    • Allowing multiple assignments determines whether the value of the control can be changed directly in the view table without having to open and edit the record in the edit form. With 1 to 5 rows and without the comment option, a text box with the value is displayed instead of the value; otherwise a link (“Modify...”, or “New comment...” with the comment option) is displayed below the value, which opens a window for changing the value. The text box and the link only appear in view tables that have multiple data assignments allowed.
    • An anonymous user may change the value in the view table under the same conditions as a logged-in user, that is according to the editing rights of the record. All anonymous visitors, however, share a single user account and are therefore the owners of every record created by any of them. If the owner may change a record, any anonymous visitor may thus change records created by another visitor as well.
    • The change is not offered for a read-only control or for records the user may not change.
    • For a required field, an empty value entered in the view table is not saved, and the user sees an error message.
  • Run OnBeforeSave/OnAfterSave before the record is saved to the database
  • For a text string data type in conjunction with the “Allow multiple assignments” option
    • Checking this box determines whether the script “OnBeforeSave” and then “OnAfterSave” should be run when saving the value of the control to the database directly from the view table, which
      • can prevent the value from being stored by triggering an interrupt,
      • or it can run additional database operations, send emails, etc.
    • If the “OnBeforeSave” script is interrupted, the user will see the text of the error message and the value will not be saved to the database.
    • If the “OnAfterSave” script interrupts, the user will receive an error message, but this will no longer affect the successful storage of the value in the database.
  • Snap to previous control
  • For all data types
    • Checking this box determines whether the control itself should be displayed to the right of the previous one in the edit form, or whether it will be displayed below the previous control in the usual way.
    • If the control snaps to the previous one, the offset width from the previous control can be defined
      • The indent is defined in pixels in a separate text box, which is located to the left of the “Width” text box.
    • A detailed description of snapping to controls is provided in the separate guide Layout settings.
  • Comment
  • For data type: Text string
    • The comment determines whether the text box should be displayed read-only with the option to enter comments using the “New comment” button located below the text box in the edit form.
    • The comment option applies only when the width is not 0 and only if the text box is not displayed in the code editor.
    • Clicking on the “New comment” button will display a new dialog with the option to enter a comment in plain text.
    • Subsequent confirmation of the entered comment using the “Insert comment” button or using the “CTRL + ENTER” key combination inserts it into the control field in the edit form
      • blank line (only if the field already contains text),
      • see the name of the author of the comment below,
      • comma and space,
      • current date and time in the NET Genium time zone,
      • go to a new line and
      • the text of the written comment itself.
    • Author
      • Login name – the author's name will be the login name of the currently logged in user
      • Name – the author's name will be the full name of the currently logged in user
    • Sorting
      • Ascending – the entered comment will be inserted at the end after a blank line
      • Descending – the written comment will be inserted at the beginning before the blank line
    • Button name
      • New comment – the text of the button will be set to the default text “New comment”
      • User defined – the button text will be set to a custom value
    • In the edit form, the comment is inserted into the field by the web browser and the whole text of the field is sent when the record is saved, so the protection of older comments against changes exists only in the browser. In the view table, the server appends the new comment to the stored value.

2.2. “Default value” tab

2.2.1. Default value

  • The default value is used for newly created records in the edit form. This is a value that is automatically pre-populated into the control when a edit form is opened to create a new record that does not already exist in the database.
  • The default value can be scheduled using the script function “SCHEDULEDEFAULTVALUE(ng_, abc)” from the script that is part of the button for opening a new edit form.
  • The drop-down list contains the following types of default values:
    • User defined – The default value is defined by a text constant, variable, or a combination of both, written in the text box below the drop-down list. Common variables include “#lastvalue#”, “#lastvalue2#”, etc.
    • Current user – login name of the currently logged in user
    • Current date
    • Current time
    • Current date and time
    • Current value in the database – the current value in the database is only relevant in connection with the check box “Fill in the default value before each saving of the record to the database”
      • The columns of some database records are also changed in the background of the operating system, for example by external applications. Typically, these are statuses, database record processing dates, etc. While a user has an open database record in the edit form, the value of such a column may be changed in the background by an external application. In this case, the value currently present in the edit form must not be used to save the record (this value was valid at the time the record was opened), but the value currently written in the database must be used.
    • From query – the default value defines the result of the database query, which is evaluated when opening the edit form
    • JavaScript – the default value is defined by a javascript function executed when opening the edit form, written in the text field below the drop-down list without a semicolon at the end. The Javascript function must return a text value.

2.2.2. Options

  • Fill in the default value every time the edit form opens up
    • Checking this box determines whether the current value in the edit form is overwritten to the default value when the existing record is opened.
    • Controls that have an external function call set as the default value, such as “ngef2(test)”, and have the default check box selected each time the edit form is opened, may have an empty or blank value in the database, and still fail when attempted to display this value is evaluated everywhere in the application except for the edit form by an external function set as the default value.
  • Fill in the default value before each saving of the record to the database
    • Checking this box determines whether the current value in the edit form is overwritten to the default value before each save of the record.
    • Controls that have an external function call set as the default value, such as “ngef2(test)”, and have the default check box selected each time a record is saved to the database, may have an empty or blank value in the database, and still try to displaying this value everywhere in the application except the edit form evaluates the external function set as the default value.
  • Only when manually changing a value in another control
    • In conjunction with the “Fill in the default value before each saving of the record to the database” option
    • Checking this box determines whether a value change in one of the other edit form controls will be evaluated before each record is saved. Only in this case will the current value in the edit form be overwritten to the default value.
    • This option is the default for the Watcher controls, i.e. “Modified by” and “Modified on”

2.3. “Events” tab

2.3.1. OnChange

  • The “onchange” event specifies a semicolon-separated list of javascript commands that are executed after a value change and then exiting the control.
  • The drop-down list offers the following frequently used javascript functions:
    • “form_Update();” – updates the edit form, for example to refresh data in view tables or in data sources of other controls
    • “bt_Click(BT);” – triggers a click on a button; “BT” is a placeholder to be replaced with the identifier of the button from the “Administration” tab of the Button control
  • A detailed description of javascript functions is provided in the separate guide JavaScript functions.

2.3.2. OnClick

  • The “onclick” event specifies a semicolon-separated list of javascript commands that are executed when the mouse is clicked on the control.
  • The drop-down list offers the following frequently used javascript functions:
    • “form_Update();” – updates the edit form, for example to refresh data in view tables or in data sources of other controls
    • “bt_Click(BT);” – triggers a click on a button; “BT” is a placeholder to be replaced with the identifier of the button from the “Administration” tab of the Button control
  • A detailed description of javascript functions is provided in the separate guide JavaScript functions.

2.3.3. OnFocus

  • The “onfocus” event specifies a semicolon-separated list of javascript commands that are executed after entering the control (when the control receives focus).

2.3.4. OnBlur

  • The “onblur” event specifies a semicolon-separated list of javascript commands that are executed when the control is exited with a tab or a click outside the control.

2.4. “Button” tab

2.4.1. Title

  • The title specifies the name of the button, which optionally appears to the right of the control itself in the edit form.
  • An empty name means that the button will not be displayed.

2.4.2. Width

  • Button width in pixels.
  • A filled-in width of “0” or “1” hides the button; an empty width leaves the decision to the browser, which derives it from the label.

2.4.3. Client

  • The “Client” field specifies a list of javascript commands that will be executed when the button is pressed. The drop-down list offers the following frequently used javascript functions:
    • Are you sure you want to ... ? – return jsConfirm(this, 'Are you sure you want to ... ?');
    • AJAX... – return bt_Eval(this, 'ngef.aspx?test', 'evalFunction');
    • control_SetValue – control_SetValue(#ng_#, '');

2.4.4. Server

  • If the “Client” field is empty, the server-side script is run after the button is pressed. If the “Client” field contains code, the script is run only if the code returns a true value with the “return” command – code without the “return” command does not run the script. The “Edit script” link is used to open the integrated graphic script designer, in which the script is defined, resp. server part of the button.
  • Execution of javascript commands can be interrupted by the command “return false;”, which prevents the subsequent execution of the script on the server side.

2.5. “Help” tab

2.5.1. Help

  • Help text is displayed to the right of the control in the edit form.
  • The help texts of all controls start at the same vertical line across the entire edit form.
  • Text – the help text is defined by a manually entered text string in a multi-line text field below the radio button
  • From query – the help text is defined by the result of a database query that is evaluated when the edit form is opened
  • A detailed description of the help text is provided in the separate guide Layout settings.

2.5.2. Notes

  • Notes are used to enter any text intended for the application administrator.

2.6. “Filter” tab

2.6.1. Options

  • Show filter in the view table
    • Checking this box determines whether the view table should be allowed to filter records by the values present in the database in the column associated with this control. The filter drop-down list is located in the header of the view table under the name of the control.
    • The filter drop-down list does not display the specific values present in the database in the column associated with this control, only the options:
      • Search for the entered value
      • Find empty values in the database
      • Finding non-empty values in the database
      • Search by compound condition

2.7. “Rights” tab

2.7.1. Rights

  • Rights define a list of user groups and users who have permission to display a control on an edit form and to display the values of that control elsewhere in the application.
  • Users who do not have control rights
    • they do not see the control or its value in the edit form, and the control is not rendered into the source code of the page in a web browser either,
    • they cannot display the column associated with this control in a view table or other visual control intended for viewing data.
    • they can create an entry in the edit form in which there is a control to which they do not have rights, the value of these controls is then set to the database value “null”,
    • by default, they cannot delete a record in an edit form containing a control to which they do not have rights; enabling “Always allow deleting to the owner or co-owner of the record” in the “ActionButtons” control is an exception.
  • An application administrator can cause a logical error when a javascript function refers to a control that may not be accessible from a rights perspective for some users. The variable “ng_” is then replaced by the value stored in the database in this control instead of a reference to the object of the control itself. In most cases, this error stops loading the edit form, it disables itself, and the user is shown a message that he should contact the application administrator. This type of error can be partially eliminated using the report “Controls (JavaScript + insufficient rights)”. The substituted value is part of the page source code – therefore, the identifier of a control with a sensitive value should not be used in JavaScript or in the “HTML” control.

2.7.2. Show value

  • The display of the control value can be limited only to the users who created the database record, or are set as co-owners of all records in the edit form settings.
  • The radio button contains the following types of value display:
    • To all users – the control, including its value, will be displayed to all users who have the right to the control
    • Only to the owner or co-owner of the record – the control, including its value, will be displayed in the edit form only to users who have the right to the control and at the same time may edit the record – a user with administrator rights, a co-owner, and the owner of the record if “Editing rights” is set to “Owner or co-owner of the record”. The control cannot be displayed as a view table column. A detailed description of how the value is displayed in other controls is provided in the separate guide Edit form.

2.7.3. Replace rights to other controls

  • The “Replace rights to other controls” function is used to unify the rights within the entire edit form for controls that are related in terms of rights.
  • Thanks to the “Show...” link, it is possible to display a list of all controls in the edit form, including setting the rights of these controls. A check box is displayed for each control to select it. When the control is saved, the same rights are then set for the selected controls.
  • An alternative for unifying rights within the entire edit form is to display the report available from the “Subordinate object rights” tab in the edit form settings.

2.8. “Administration” tab

  • The “Administration” tab is only displayed for existing controls.

2.8.1. Identifier

  • The identifier specifies the name of the database column in which the values entered through the control in the edit form are stored in the database.
  • The identifier is derived from the name of the control. It starts with the prefix “ng_”, and also contains the alphanumeric characters used in the control name (system controls do not include the prefix “ng_”). When changing the name of the control, the “Correct” button is available, which is used to correct the identifier, and thus to rename the database column in the database. For clarity and to eliminate possible misunderstandings, it is recommended to keep the identifier in accordance with the name of the control element. If external applications also access the database and, for example, read or write data to this column, it is necessary to schedule the change of the identifier until a suitable time.

2.8.2. Full identifier

  • The full identifier of the control also contains the identifier of the edit form, and is used in printing templates.

2.8.3. Encryption

  • Encryption determines whether the values stored in this column in the database will be encrypted using either the default encryption key or the encryption key specified in the optional configuration file “Config\EncryptionKey.txt”.
  • Decrypted values can be displayed only in the edit form, everywhere else in the application the placeholder string “*****” is displayed instead of specific values stored in the database.
  • When encryption is turned on later, all values stored in this column in the database are encrypted.
  • When encryption is turned off later, all values stored in this column in the database are decrypted.
  • Enabled encryption turns off searching in the view table – the “Search in the view table” option is displayed as “Deny”.

2.8.4. Search in the view table

  • The search determines the way the records in the view table will be searched in the database after entering the search term or phrase.
  • Textarea supports the following search types:
    • LIKE (contains) – normal “case-insensitive” search using the “LIKE” clause
    • CONTAINS (MSSQL Full-Text) – full-text “case-insensitive” search using the “CONTAINS” clause, which is supported by MSSQL databases. Checking this option will automatically create a full-text index on the database.
    • Deny – Searching in this column is disabled, and there is no check box in the view table to include the table column in the list of columns to be searched.
    • Search without diacritics – Checking this box will ensure that diacritics are first removed from the search term or phrase entered in the view table. For such a search to work, it is important to ensure that the values in the database in this column are also stored without diacritics, typically in the “OnBeforeSave” script using the “REMOVEDIACRITICS()” function.

2.8.5. Other

  • Change type to
    • The drop-down list offers the types of controls to which conversion of the control is supported, including automatic conversion of the data present in the database table.

2.8.6. Statistics

  • Statistics display aggregated information about control usage across the entire application.
  • Using the “Statistics” button, a detailed report of all places where the control is used or referenced is displayed, including the possibility to open the settings of such a place or control.
  • Before each change of control type or data type, or before each deletion of a control from the edit form, it is recommended to thoroughly go through the control statistics, and eliminate any misunderstandings.
  • Before each deletion of the control from the edit form, the evaluation of the statistics starts automatically. If the control is used or referenced somewhere in the application, it is necessary to confirm the deletion of the control again.

2.9. Picker

  • The magnifier-icon located in the lower-left corner of the dialog is used to configure the picker for this control.
  • A detailed description of the picker is provided in the separate guide Picker.

2.10. “Save”, “Save and continue editing”, “Copy”, “Delete”, and “Close” buttons

  • “Save” button – Saves changes to the control settings.
  • “Save and continue editing” button – Saves changes to the control settings and keeps the settings dialog open for further modifications.
  • “Copy” button – Creates a new copy of the current control with identical settings, but with a newly generated unique identifier.
  • “Delete” button – Permanently deletes the control.
  • “Close” button – Closes the control settings dialog without saving changes.

3. Examples

3.1. Javascript functions

3.1.1. General functions

  • var s = control_GetValue(#ng_#);
  • var s = #ng_#.value;
  • control_SetValue(#ng_#, s);
  • control_SetValue(#ng_#, 'abc');
  • ta_Insert(#ng_#, 'abc');
  • picker_Open(#ng_#);

3.1.2. Text strings

  • #ng_#.value = 'abc';

3.1.3. Source codes, HTML, XML, JavaScript, C#, C++

  • ta_InitColorWords(['a', 'b']);
  • ta_FormatAll(#ng_#);

3.2. Server functions

  • SCHEDULEDEFAULTVALUE(ng_, #ng_#)
  • FORMATSTRING({0} – {1}, A, B)
  • REQUESTQUERYSTRING(abc)
  • SUBSTRING(abc, 0, 1)