🌊
jsf
  • About KalmiaJSF
  • Setup
  • Architecture
  • Contributing
  • Changelog
  • Guides
    • Cheat Sheet
  • Examples
    • Demo example
    • Basic examples
    • Kitchen Sink example
    • Charts example
  • Schema
    • Intro to Schema
    • Prop types
      • String
      • Boolean
      • Number & Integer
      • Object
      • Array
      • Date
      • Id
      • Null
      • Ref
      • Binary
    • Prop options
      • Disabling property
      • On prop init actions
      • Persist
      • On value change
      • On user value change
    • Handlers
      • Color picker
    • Creating custom handler
      • Working with arrays
    • Value provider
  • Validation
    • Custom validation
    • Eval
  • LAYOUT
    • Intro to Layout
    • Layout options
      • Show & hide
      • On click action
  • INTERFACES
    • Value Options
  • Form
    • Form data
  • OTHER
    • Events
    • Lifecycle hooks
    • Notifications support
  • PAGES & COMPONENTS
    • Page
    • Component
  • THEMING
    • Creating new theme variant
  • BUILDER
    • Shortcuts
  • Help
    • FAQ
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. OTHER

Lifecycle hooks

There are several lifecycle hooks available for you to subscribe to and perform various actions in response to events.

These lifecycle hooks can be defined on the JSF definition as such:

$lifeCycle?: {
  $beforeFormInit?: {
    $eval: string;
  };
  $afterFormInit?: {
    $eval: string;
  };
  $beforeFormDestroy?: {
    $eval: string;
  }
  $afterFormDestroy?: {
    $eval: string;
  },
  $onFormValueChange?: {
    $eval: string;
  },
  $onFormStatusChange?: {
    $eval: string;
  }
};

List of available lifecycle hooks:

Lifecycle hook

JSF lifecycle property

Description

Before form init

$beforeFormInit

Called before the JSF builder instance is created which allows you to modify the document or builder options. Provides two eval context variables:

  • $doc JSF document

  • $optionsBuilder options

After form init

$afterFormInit

Called after the JSF builder instance was created. Note that the Angular layout

omponents have not yet been created at this stage.

Before form destroy

$beforeFormDestroy

Called before the JSF builder instance is about to be destroyed, due to the Angular jsf doc component being destroyed or otherwise.

After form destroy

$afterFormDestroy

Called after the JSF builder instance has been destroyed.

Form value change

$onFormValueChange

Called every time a form property's value changes. Provides two additional eval context variables:

  • $path Path of changed prop

  • $data An object containing the information about the change

Form status change

$onFormStatusChange

Called every time a form's property state changes (valid, invalid, disabled, ...). Provides two additional eval context variables:

  • $from An object containing information about the changed prop path

  • $data An object containing information about the status change

PreviousEventsNextNotifications support

Last updated 4 years ago

Was this helpful?