This component is used to automatically generate a UI for any field in a given BaseEntity object. The CodeGen tool will generate forms and form sections that use this component. This component automatically determines the type of the field and generates the appropriate UI element for it. It is possible to use other elements to render a field as desired in a custom form, think of this component as a nice "base" component you can use for many cases, and you can create custom components for field rendering/editing when needed.

Hierarchy (view full)

Implements

  • AfterViewInit

Constructors

Properties

EditMode: boolean = false

EditMode must be bound to the containing form's edit mode/state. When the form is in edit mode, the field will be rendered as an editable control (if not a read only field), otherwise the field will be rendered read-only.

EncryptedDisplayMask: "••••••••" = '••••••••'

The masked display text for encrypted values (shows dots instead of actual value)

FieldName: string = ''

The name of the field in the entity to be rendered.

LinkComponentType: "Search" | "Dropdown" = 'Dropdown'

Optional, when the field type is a linked field, you can specify if a search box is shown or a dropdown component is shown. The default is 'search'.

LinkType: "URL" | "None" | "Email" | "Record" = 'None'

Optional, the type of link field that should be shown. Email and URL fields will be rendered as hyperlinks, Record fields will be rendered as links to the record. The default is 'None'. Record Fields are only valid when the FieldName field is a foreign key field to another entity.

ShowLabel: boolean = true

If set to false, the label for the field will not be shown. The default is true.

Type: "code" | "textarea" | "checkbox" | "datepicker" | "textbox" | "numerictextbox" | "dropdownlist" | "combobox" = 'textbox'

The type of control to be rendered for the field. The default is 'textbox'. Other possible values are 'textarea', 'numerictextbox', 'datepicker', 'checkbox', 'dropdownlist', 'combobox', 'code'.

ValueChange: EventEmitter<any> = ...
_displayName: null | string = null
_encryptedEditValue: string = ''

For encrypted fields in edit mode where AllowDecryptInAPI=false, we need a separate edit value that starts empty (user can't see existing value)

_possibleValues: null | string[] = null
formContext?: BaseFormContext

Form context containing all form-level state (filter, showEmptyFields, etc.)

hideWhenEmptyInReadOnlyMode: boolean = true

When true (default), the field will be hidden when it has no value and is in read-only mode. This helps reduce visual clutter by hiding empty fields.

isEncryptedValueRevealed: boolean = false

Controls whether the encrypted value is currently visible (for AllowDecryptInAPI=true fields)

isNewValueRevealed: boolean = false

Controls whether the new value being typed is visible (for blind edit mode)

languages: LanguageDescription[] = languages
markdown: undefined | MarkdownComponent
record: BaseEntity<unknown>

The record object that contains the field to be rendered. This object should be an instance of BaseEntity or a derived class.

renderer: Renderer2

Accessors

  • get AllowDecryptInAPI(): boolean
  • Returns true if the field allows decrypted values to be shown in the API

    Returns boolean

  • get CanRevealEncryptedValue(): boolean
  • Returns true if the encrypted field has a value that can be revealed (AllowDecryptInAPI=true)

    Returns boolean

  • get DisplayName(): string
  • Display Name to show on the the control. By default, this is derived from the DisplayName in the entity field metadata, and can be overridden if desired by setting this property manually. Leave it empty to use the default.

    Returns string

  • set DisplayName(newValue): void
  • Parameters

    • newValue: string

    Returns void

  • get EncryptedEditValue(): string
  • Gets the value for editing encrypted fields. For AllowDecryptInAPI=false fields, returns empty string initially (user can't see existing value) For AllowDecryptInAPI=true fields, returns the actual value

    Returns string

  • set EncryptedEditValue(newValue): void
  • Sets the encrypted edit value and updates the record

    Parameters

    • newValue: string

    Returns void

  • get HighlightedDisplayName(): string
  • Returns the display name with search highlighting applied if formContext.sectionFilter is set

    Returns string

  • get IsBlindEncryptedEdit(): boolean
  • Returns true if editing an encrypted field that doesn't allow viewing existing value

    Returns boolean

  • get IsEncryptedField(): boolean
  • Returns true if the field is configured for encryption in the entity metadata

    Returns boolean

  • get IsFieldReadOnly(): boolean
  • Returns true if the field is read only. This is determined by the ReadOnly property in the entity field metadata.

    Returns boolean

  • get IsValueEncryptedSentinel(): boolean
  • Returns true if the field's current value is the encrypted sentinel value, indicating that the actual value is protected and cannot be shown.

    Returns boolean

  • get IsValueProtected(): boolean
  • Returns true if the field's current value should be treated as protected for display purposes. For encrypted fields where AllowDecryptInAPI=false, any non-empty value should be hidden.

    Returns boolean

  • get PossibleValues(): string[]
  • The possible values for the field. This is only used when the field is a dropdownlist or combobox. The possible values are derived from the EntityFieldValues in the entity field metadata. If the field is not a dropdownlist or combobox, this property is ignored. If you would like to specify a custom list of values, you can set this property manually.

    Returns string[]

  • set PossibleValues(newValue): void
  • Parameters

    • newValue: string[]

    Returns void

  • get shouldHideField(): boolean
  • Returns true if the field should be hidden (empty value in read-only mode with hideWhenEmptyInReadOnlyMode enabled)

    Returns boolean

Methods

  • Toggles the visibility of the new value being typed (for blind edit mode)

    Returns void