Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the component. |
properties |
Object
|
HTMLElement
|
The properties used to initialize the component or the container element. |
Returns:
An instance of the component.
-
Type
-
Object
Extends
Members
borderless :Boolean
Gets or sets a value indicating if the form field is rendered without the top, left and right borders.
Type:
cssClassBorderless :String
Gets or sets the css class which is appended to the formfield class when borderless is enabled.
Type:
cssClassContentWrapper :String
Gets or sets the css class of the form field content wrapper element when wrapFieldContent is set to true or the field root element is not an input field and the label display is set to above/floating/inside.
Type:
cssClassInline :String
Gets or sets the css class which is appended to the formfield class when inline is enabled.
Type:
cssClassLabel :String
Gets or sets the css class of the form field label element.
Type:
cssClassRequired :String
Gets or sets the css class which is appended to the formfield class when required is enabled.
Type:
cssClassSwitch :String
Gets or sets the css class which is appended to the formfield class when switch is enabled.
Type:
Gets or sets the css class of the form field tooltip icon element.
Type:
cssClassTransparent :String
Gets or sets the css class which is appended to the formfield class when transparent is enabled.
Type:
disabled :Boolean
Gets or sets a value indicating if the form field is disabled.
Type:
inline :Boolean
Gets or sets a value indicating whether the formfield is displayed as inline or block element.
Type:
label :String
Gets or sets the text label.
Type:
Gets or sets a value indicating whether the label is displayed automatically, inside, above, before or after the form input field.
Type:
required :Boolean
Gets or sets a value indicating if the form field is required.
Type:
switch :Boolean
Gets or sets a value indicating if the form field must be rendered as switch control. This option has effect only when the field is an input of type checkbox.
Type:
Gets or sets the id of the tooltip to show.
Type:
Gets or sets the tooltip manager used to display tooltips.
Type:
transparent :Boolean
Gets or sets a value indicating if the checkbox or radio field must be rendered transparent.
Type:
wrapFieldContent :Boolean
Gets or sets a value indicating if the form field content is placed inside a wrapper element.
Type:
(static, readonly) LabelDisplayOption :number
Type:
Properties:
| Name |
Type |
Description |
AUTO |
number
|
The label display depends on the field type: displayed after when the field is a checkbox or radiobutton,
displayed floating when the field is a basic textual input and displayed above for all other field types. |
FLOATING |
number
|
the label is displayed inside the field when empty and not focused otherwise it will be displayed above the field. |
INSIDE |
number
|
the label is displayed inside the field and will be cleared when the input field gets focus, allowing placeholder to become visible. |
ABOVE |
number
|
the label is displayed above the field. |
BEFORE |
number
|
the label is displayed before the field. |
AFTER |
number
|
the label is displayed after the field. |
getName |
number
|
|
Methods
disable()
enable()
Links the label to the nested input by setting htmlFor and, if necessary, assigning an ID to the input.
Adds a placeholder attribute if missing to support CSS styling.
postRender()
Handles the post render procedure.
render()
setBorderless(enable)
Enables or disables the borderless field style.
Parameters:
| Name |
Type |
Description |
enable |
Boolean
|
A value indicating if the option should be enabled or disabled. |
setFieldTemplate(content)
Adds the content template for the field.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
The field template content. |
setInline(enable)
Enables or disables the inline state of the form field.
Parameters:
| Name |
Type |
Description |
enable |
Boolean
|
A value indicating if the option should be enabled or disabled. |
setLabelDisplay(display)
Sets the label display type (inside above before after).
Parameters:
setLabelTemplate(content)
Adds the content template for the label.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
The label template content. |
setRequired(enable)
Enables or disables the required state of the form field.
Parameters:
| Name |
Type |
Description |
enable |
Boolean
|
A value indicating if the option should be enabled or disabled. |
setSwitch(enable)
Enables or disables the switch field style.
Parameters:
| Name |
Type |
Description |
enable |
Boolean
|
A value indicating if the option should be enabled or disabled. |
setTransparent(enable)
Enables or disables the transparent field style.
Parameters:
| Name |
Type |
Description |
enable |
Boolean
|
A value indicating if the option should be enabled or disabled. |
updateLabel(content)
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
The label template content. |
Recreates the tooltip icon for the element and updates its trigger in the tooltip manager.