FieldGroup
import {FieldGroup} from 'cx/widgets';The FieldGroup widget is pure container which allows disabling of multiple form elements using
a single property. ValidationGroup widget may be used for this purpose too, under the hood, FieldGroup
is just an alias for it.
<Checkbox value-bind="$page.enabled">Enabled</Checkbox>
<Checkbox value-bind="$page.readOnly">ReadOnly</Checkbox>
<Checkbox value-bind="$page.viewMode">ViewMode</Checkbox>
<FieldGroup
layout={LabelsLeftLayout}
enabled-bind="$page.enabled"
readOnly-bind="$page.readOnly"
viewMode-bind="$page.viewMode"
tabOnEnterKey
>
<TextField label="First Name" value-bind="$page.firstName" required/>
<TextField label="Last Name" value-bind="$page.lastName" required/>
<Checkbox label="Status" value-bind="$page.active" text="Active" emptyText="Inactive" />
<Button text="Button" />
</FieldGroup>| Property | Description | Type |
|---|---|---|
asterisk | Set to | boolean |
disabled | Set to | boolean |
enabled | Set to | boolean |
invalid | Binding which will be set to true if any of child form field reports validation error. | boolean |
isolated | Set to | boolean |
readOnly | Set to | boolean |
strict | Set to | boolean |
tabOnEnterKey | Set to | boolean |
valid | Binding which will be set to true if all child form field are valid. | boolean |
viewMode | Set to | boolean |
items | List of child elements. | array |
layout | Define an inner layout. | string/object |
mod | Appearance modifier. For example, | string/array |
outerLayout | Defines the outer layout which wraps the widget. | widget |
plainText | Set to | boolean |
preserveWhitespace | Keep whitespace in text based children. Default is | boolean |
putInto | Used with outer layouts. Specifies the name of the content placeholder which should render the widget. | string |
trimWhitespace | Remove all whitespace in text based children. Default is | boolean |
vdomKey | Key that will be used as the key when rendering the React component. | string |
visible | Visibility of the widget. Defaults to | boolean |