The changes requested by setters in this API are not applied immediately. They are batched and their application is postponed until the onInit or onChange callback execution ends. This means that reading the values using getters will always provide the initial form field state, which is immutable.
getId
getId(): string
Returns the field's ID.
getType
getType(): FieldType
Returns the field's type.
setName
setName(value: string): FieldAPI
Changes the field's name.
Example:
field.setName('New name for the field');
getName
getName(): string
Returns the field's name.
setDescription
setDescription(value: string): FieldAPI
Changes the field's description.
Example:
field.setDescription('This the description!');
getDescription
getDescription(): string
Returns the field’s description.
setRequired
setRequired(value: boolean): FieldAPI
Set a given field as required. Fields required by system configuration can't be set to non-required. Example:
field.setRequired(true);
isRequired
isRequired(): boolean
Returns true if the field is currently required. Returns false otherwise.