🌊
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. Schema

Handlers

In order to control behavior of prop and display on layout, you can use handlers. With handlers, you can change default behavior of props.

All handlers are written as async Angular modules, meaning they are loaded only when needed.

Classic example would be color picker. Even though we store color in HEX format as a string, we don't wish to display it as plain text input. For that we can use common/color-picker to display nice color picker on UI part and force correct HEX format in string prop. Meaning if we loaded invalid value from DB for example, prop would be marked as invalid.

Color picker example:

{
  "type": "string",
  "handler": {
    "type": "common/color-picker"
  }
}

Other classic example is any handler. When we use this handler we can set any type of value on prop, mimicking any type in TypeScript.

PreviousOn user value changeNextColor picker

Last updated 4 years ago

Was this helpful?