TextField / Textarea
<input id="customer_street"
type="text"
data-win-control="HFWinJSCtrl.TextField"
data-win-options="{
label: 'Address: Street name'
}">
<textarea id="repair_remark"
style="min-height:110px; height:auto"
data-win-control="HFWinJSCtrl.TextField"
data-win-options="{
label: 'Remark'
}"></textarea>
Please ensure there is no non breaking space or line break between the 'textarea'-opening and closing tag. Otherwise the cursor will not be positioned at the correct place on focus.
FormControl Options
autoResize
Set "true" whenever the Textarea should be auto resized on typing.
autoResize: true
boolean
charCounter
Set "true" whenever the Textarea should display a character counter. It gets updated on every key stroke. The maxlength amount is taken from the validator.
charCounter: true
boolean
defaultValue
Provide a default text inside your input field. A custom code function can be used to set defaultValue.
defaultValue: 'Default Text'
string | function
function() => string
disabled
Set "true" whenever the TextField/Textarea should be disabled.
disabled: true
boolean
displayOnly
Disables the Textfield and makes it readonly, without input styling.
displayOnly: 'true'
boolean
doNotCopy
Set "true" whenever the field should get deleted if form is copied.
doNotCopy: true
boolean
list
Set this property to "true" if data connected with this control should be a sorting/filtering/grouping option on the listpage, is used in template objects (eg. the listTemplate) or it should show up in admin ui listings.
list: true
boolean
listOptions
Set additional options for controls with list equals true. E.g. set custom label for filter/sort/group dialogs or hide them complettely.
listOptions: {...}
{ dialogText: string, dialogHide: boolean }
mask
Used to give the user an input mask. For more information visit: https://imask.js.org/guide.html.
mask: '(000) 000-0000'
string
maskOptions
Used to define an input mask more precise. For more information visit: https://imask.js.org/guide.html.
maskOptions: {...}
AnyMaskedOptions | function
function() => AnyMaskedOptions
onChanged
Call a pre-defined JS-method to do something when the status of the control changes.
onChanged: HFFormdefinition.Namespace.Method
function
function(value: string) => void
persistent
The value "user" sets the initial value of the TextField to the value of the previous form item of the current user and overwrites any defaultValue.
persistent: 'user'
'user'
tooltip
Write a comment to provide further information about the field. A question mark will then be shown within the label and with a click/tap on it, the information will occur.
tooltip: 'Please fill in a remark.'
string
tooltipTemplate
Write an id of a html container to provide further information about the field. A question mark will then be shown within the label and with a click/tap on it, the content of the container will occur.
tooltipTemplate: 'example_control_tooltip'
string
visiting
Set "true" whenever the form element should be marked as "visited" when the user has clicked or tapped at the form field.
visiting: true
boolean
A textarea is a special kind of a TextField. You can specify the look-and-feel of the textarea by providing style information. Set the minimal height "min-height" and the behavior of the textarea scrolling by setting the style attribute height to "auto".
listOptions Object
dialogText
Set custom label for filter/sort/group dialogs.
dialogText: 'Display Text'
string
copyValueTo
Define FormControls in which the entered value should be copied.
<input id="textfield_multiple_copy_source"
type="text"
data-win-control="HFWinJSCtrl.TextField"
data-win-options="{
label: 'TestField: source',
copyValueTo: [
'textfield_multiple_copy_traget_1',
'textfield_multiple_copy_traget_2'
]
}">
interface ICopyValueToObject {
targetId: string;
mode: 'overwrite' | null;
shadowPostfix: string;
callback: (value: string) => string;
}
type CopyValueToType = string | ICopyValueToObject | Array<string | ICopyValueToObject>;
callback
Specify a function to process value before copy.
callback: HFFormDefinition.Namespace.processValue
function
function(value: string) => string
mode
Specify if target field gets overwritten. Default behviour is to only copy to empty fields.
mode: 'overwrite'
string
shadowPostfix
Specify which shadow field is copied.
shadowPostfix: '_HFNumericField'
string
Stored data
The simplest storage – id and the filled-in value:
{
"id": "customer_street",
"value": "Cranfield Road"
}
MaskedInput data
<input id="masked_input"
type="text"
data-win-control="HFWinJSCtrl.TextField"
data-win-options="{
label: 'Phone number',
mask: '(000) 000-0000'
}">
First the raw input data
{
"id": "masked_input",
"value": "1234567890"
}
and second for the masked value
{
"id": "masked_input_HFMaskedValue",
"value": "(123) 456-7890"
}