Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Styling Classes
-
.oj-formlayout-full-width
-
In Redwood by default a form layout has a max width, add this class if you'd like to opt out and have the form layout to stretch the full width.
Example
<oj-form-layout class="oj-formlayout-full-width"> </oj-form-layout>
Slots
JET components that allow child content support slots. Please see the slots section of the JET component overview doc for more information on allowed slot content and slot types.
-
Default
-
The
<oj-form-layout>element only accepts element children in the Default slot. Content in<oj-form-layout>'s Default slot will be laid out in a row/column style form layout.- Since:
- 4.1.0
Attributes
-
colspan-wrap :nowrap|wrap
-
Specifies how to fit components with colspan attribute in the form layout, when there are fewer columns left in the current row than the colspan value specifies.
The default value depends on the theme.
Supported Values:
Value Description nowrapThe component will occupy the remaining columns in the current row. wrapThe component will start from the first column of the next row. Names
Item Name Property colspanWrapProperty change event colspanWrapChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-colspan-wrap-changed -
direction :column|row
-
Specifies the layout direction of the form layout children.
The default value depends on the theme.
Supported Values:
Value Description columnComponents are laid out in columns rowComponents are laid out in rows Names
Item Name Property directionProperty change event directionChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-direction-changed -
label-edge :inside|start|top
-
Specifies how the label is created and aligned with its form control.
The default value varies by theme, and it works well for the theme in most cases. If this attribute is set to an explicit value, The label-edge attribute on all form controls should also be set to an explict value. For example, if this attribute is set to "start" or "top", the label-edge attribute of all form controls should be set to "provided".
Supported Values:
Value Description insideoj-form-layout will not create any label. Label will be created by the form control if the form control has its label-edge set to "inside". Please see the specific form control's label-edge attribute documentation for details. startoj-form-layout will create a label that's before the start of the form control if the form control has its label-edge set to "provided". If the form control specifies "inside" or "none" as its label-edge, no label will be created by oj-form-layout. topoj-form-layout will create a label that's on top of the form control if the form control has its label-edge set to "provided". If the form control specifies "inside" or "none" as its label-edge, no label will be created by oj-form-layout. Names
Item Name Property labelEdgeProperty change event labelEdgeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-label-edge-changed -
label-width :string
-
Specifies the label width.
This specifies the width of the oj-label elements. This can be any legal CSS width.
- Default Value:
"33%"
Names
Item Name Property labelWidthProperty change event labelWidthChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-label-width-changed -
label-wrapping :truncate|wrap
-
Specifies if the label text should wrap or truncate.
- Default Value:
"wrap"
Supported Values:
Value Description truncateLabel will truncate if needed wrapLabel will wrap if needed Names
Item Name Property labelWrappingProperty change event labelWrappingChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-label-wrapping-changed -
max-columns :number
-
Specifies the maximum number of columns. The actual number of columns may be less, depending on the direction attribute.
If direction is "column", the layout is responsive and browsers automatically reduce the number of columns to fit the width of the viewport.
If direction is "row", the number of columns is fixed to the max-columns value. Applications can choose to make it responsive by using ResponsiveKnockoutUtils to adjust the value. See the oj-form-layout - Across demo for an example.
- Default Value:
1
Names
Item Name Property maxColumnsProperty change event maxColumnsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-max-columns-changed -
readonly :boolean
-
Specifies whether the form is readonly. A readonly form has no reserved rows for user assistance text.
The oj-form-layout provides its readonly attribute value and the form components consume it if it is not already set explicitly. For example, if oj-form-layout is set to readonly='true', all the form components it contains will be readonly='true' by default.
- Default Value:
false
Names
Item Name Property readonlyProperty change event readonlyChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-readonly-changed -
user-assistance-density :('reflow'|'efficient'|'compact')
-
Specifies the density of the form component's user assistance presentation. It can be shown inline with reserved rows to prevent reflow if a user assistance text shows up, inline without reserved rows, or it can be shown compactly in a popup instead.
The oj-form-layout provides its user-assistance-density attribute value or its default value and the form components consumes it if it is not already set explicitly. For example, if oj-form-layout is set or defaults to user-assistance-density='efficient', all the form components it contains will be user-assistance-density='efficient' by default. This is why when a form component is inside an oj-form-layout component the form component's user-assistance-density is 'efficient', and when a form component is not inside an oj-form-layout component, the form component's user-assistance-density is 'reflow'.
A form component can explicitly set its own user-assistance-density attribute which will take precedence over the oj-form-layout's.
This attribute is ignored in the Alta theme.
- Default Value:
"efficient"
Supported Values:
Value Description compactmessages, help, hints, and required will not be shown inline; they will show in a mode that keeps the screen more compact, like a popup for the messages, and a required icon to indicate Required. efficientmessages, help, hints, and required are all shown inline under the field with reserved space underneath. reflowIf reflow, messages, help, hints, and required are all shown inline under the field with no reserved space. Names
Item Name Property userAssistanceDensityProperty change event userAssistanceDensityChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-user-assistance-density-changed
Methods
-
getProperty(property) : {any}
-
Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
refresh() : {void}
-
Refreshes the visual state of the component.
Returns:
- Type
- void
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesObject An object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. Returns:
- Type
- void