The object
field.
Title | Object Field |
Description | Object field for containing other fields |
JSON Schema Type(s) | object |
Field Type | object |
Base Field Type | None |
Property | Type | Default | Description |
---|---|---|---|
default | any | The default value to be assigned for this property. If the data for the field is empty or not provided, this default value will be plugged in for you. Specify a default value when you want to pre-populate the field's value ahead of time. | |
dependencies | array | List of property dependencies. | |
description | string | Detailed description of the property. | |
disallow | array | List of disallowed values for the property. | |
format | string | Data format of the property. | |
maxProperties | number | The maximum number of properties that this object is allowed to have | |
minProperties | number | The minimum number of properties that this object is required to have | |
properties | object | List of child properties. | |
readonly | boolean | Indicates that the field is read-only. A read-only field cannot have it's value changed. Read-only fields render in a grayed-out or disabled control. If the field is rendered using a view with the displayReadonly attribute set to false, the read-only field will not appear. | |
required | boolean | Indicates whether the field's value is required. If set to true, the field must take on a valid value and cannnot be left empty or unassigned. | |
title | string | Short description of the property. | |
type | string | object | Data type of the property. |
Property | Type | Default | Description |
---|---|---|---|
animate | boolean | true | Up and down transitions will be animated |
collapsed | boolean | Field set is initially collapsed if true. | |
collapsible | boolean | Field set is collapsible if true. | |
disabled | boolean | Field will be disabled if true. | |
fieldClass | string | Specifies one or more CSS classes that should be applied to the dom element for this field once it is rendered. Supports a single value, comma-delimited values, space-delimited values or values passed in as an array. | |
fields | object | List of options for child fields. | |
focus | checkbox | true | If true, the initial focus for the form will be set to the first child element (usually the first field in the form). If a field name or path is provided, then the specified child field will receive focus. For example, you might set focus to 'name' (selecting the 'name' field) or you might set it to 'client/name' which picks the 'name' field on the 'client' object. |
form | object | Options for rendering the FORM tag. | |
helper | string | Field help message. | |
helpers | array | An array of field help messages. Each message will be displayed on it's own line. | |
helpersPosition | string | below | Defines the placement location of the helper text relative to the control (either 'above' or 'below') |
hidden | boolean | Field will be hidden if true. | |
hideInitValidationError | boolean | Hide initial validation errors if true. | |
id | string | Unique field id. Auto-generated if not provided. | |
label | string | Field label. | |
lazyLoading | boolean | Child fields will only be rendered when the fieldset is expanded if this option is set true. | |
legendStyle | string | button | Field set legend style. |
optionLabels | array | An array of string labels for items in the enum array | |
order | number | Allows for optional specification of the index of this field in the properties array. | |
readonly | boolean | Field will be readonly if true. | |
showMessages | boolean | true | Display validation messages if true. |
type | string | object | Field type. |
validate | boolean | true | Field validation is required if true. |
view | string | Allows for this field to be rendered with a different view (such as 'display' or 'create') |
A simple object field. If you give Alpaca an object as it’s data, it automatically figures out what to do and sets up both sub-fields for you.
Here we provide a schema to go along with our data. The schema simply provides a bit more information about the two sub-fields, such as their type and labels.
Here is a more complex example that provides the data, schema and options for all of the sub-fields of the object.
Object field with schema, options and view parameter.
Object field with default value.
Object field with lazy loading option. The lazy loading option is useful for improving performance of rendering forms for large schemas.
Object field rendered in display-only mode. The gender
field is hidden.
Object with a required field specified at the field level.
Object with a required field specified at the object-level.
Object that utilizes field-level order
property to apply an order to child fields.
Here is an example of an object field where we use a top-level layout and a nested override of the view to force the email address into display mode only.