🌊
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
  • type
  • $comment
  • default
  • advancedDefault
  • const
  • required
  • virtual
  • nullable
  • readonly
  • writeonly
  • searchable

Was this helpful?

Export as PDF
  1. Schema

Prop options

All props share some common properties that can help you change the default behavior.

type

Defines prop type, valid values are null, object, array, string, number, integer, date, boolean, id, binary.

$comment

Intended for notes to schema maintainers, as opposed to "description" which is suitable for display to end users.

default

The default keyword specifies a default value for an property. Additional you can overwrite default with advancedDefault keyword. With advancedDefault you can set default from URL query component value or from custom JavaScript code.

Bottom example first tries to set default from http://localhost?email= URL encoded value if not found it will fallback to default keyword.

"email": {
  "type": "string",
  "format": "email",
  "default": "info@example.com",
  "advancedDefault": {
    "query": "email"
  }
}

default interface

Value must be same type as property type.

advancedDefault

advancedDefault interface

Parameters

Type

Description

query

string

$eval

string

Custom JavaScript code. Code must return value.

Example: return 123;

const

Force value of prop. Can't be changed.

required

If required: true prop value is required.

virtual

Props that have virtual: true will be ignored when calling getValue({ virtual: false}).

nullable

Experimental

readonly

If readonly: true input field is disabled.

writeonly

Depends on your API implementation.

searchable

Depends on APP and API implementation. Not directly used in JSF core.

searchable?: {

    title?: string;

    /**
     * If enabled it will be displayed to user under More button, when using advanced search.
     */
    byUser?: {

      /**
       * Only show search field if specific mode is present.
       */
      $mode?: string;
      enabled?: true;
    }
  }
PreviousBinaryNextDisabling property

Last updated 4 years ago

Was this helpful?