TextField / Textarea
<input
id="customer_street"
type="text"
data-hf-control="TextField"
data-hf-options="{
label: 'Address: Street name'
}"
/>
<textarea
id="repair_remark"
style="min-height:110px; height:auto"
data-hf-control="TextField"
data-hf-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
autoResize: truebooleancharCounter
charCounter: truebooleandefaultValue
defaultValue: 'Default Text'string | functionfunction() => stringdisabled
disabled: truebooleandisplayOnly
displayOnly: 'true'booleandoNotCopy
doNotCopy: truebooleanlist
list: truebooleanlistOptions
{ dialogText: string, dialogHide: boolean }mask
mask: '(000) 000-0000'stringmaskOptions
maskOptions: {...}AnyMaskedOptions | functionfunction() => AnyMaskedOptionsonChanged
onChanged: HFFormdefinition.Namespace.Methodfunctionfunction(value: string) => voidpersistent
persistent: 'user''user'tooltip
tooltip: 'Please fill in a remark.'stringtooltipTemplate
tooltipTemplate: 'example_control_tooltip'stringvisiting
visiting: truebooleanA 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
dialogText: 'Display Text'stringcopyValueTo
Define FormControls in which the entered value should be copied.
<input id="textfield_multiple_copy_source"
type="text"
data-hf-control="TextField"
data-hf-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
callback: HFFormDefinition.Namespace.processValuefunctionfunction(value: string) => stringmode
mode: 'overwrite'stringshadowPostfix
shadowPostfix: '_HFNumericField'stringcopyValueFrom
Define a FormControl that synchronizes its value with the current field. This synchronization process occurs upon navigating to the page where the current control is situated. It only occurs if the field is empty or the mode is set to "overwrite".
<input id="textfield_multiple_copy_target"
type="text"
data-hf-control="TextField"
data-hf-options="{
label: 'TestField: target',
copyValueFrom: 'textfield_multiple_copy_source'
}">
interface ICopyValueFromObject {
sourceId: string;
mode: 'overwrite' | null;
callback: (value: string) => string;
}
type CopyValueFromType = string | ICopyValueFromObject;
callback
callback: HFFormDefinition.Namespace.processValuefunctionfunction(value: string) => stringmode
mode: 'overwrite'stringStored 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-hf-control="TextField"
data-hf-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"
}