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: true
boolean
charCounter​
charCounter: true
boolean
defaultValue​
defaultValue: 'Default Text'
string | function
function() => string
disabled​
disabled: true
boolean
displayOnly​
displayOnly: 'true'
boolean
doNotCopy​
doNotCopy: true
boolean
label​
label: 'Addrees: Street name'
string
list​
list: true
boolean
listOptions​
{ dialogText: string, dialogHide: boolean }
mask​
mask: '(000) 000-0000'
string
maskOptions​
maskOptions: {...}
AnyMaskedOptions | function
function() => AnyMaskedOptions
onChanged​
onChanged: HFFormdefinition.Namespace.Method
function
function(value: string) => void
persistent​
persistent: 'user'
'user'
tooltip​
tooltip: 'Please fill in a remark.'
string
tooltipTemplate​
tooltipTemplate: 'example_control_tooltip'
string
visiting​
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​
dialogText: 'Display Text'
string
copyValueTo​
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.processValue
function
function(value: string) => string
mode​
mode: 'overwrite'
string
shadowPostfix​
shadowPostfix: '_HFNumericField'
string
copyValueFrom​
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.processValue
function
function(value: string) => string
mode​
mode: 'overwrite'
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-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"
}