EccRadioGroup
EccRadioGroup shows all options at once - as radio buttons (single) or checkboxes (multiple).
import { EccRadioGroup } from "@/ecc/components/forms/EccRadioGroup";
The component uses a subset of the basic props of all field components - see Component Basics.
Examples
<EccRadioGroup id="purchase-request-kind" fieldLabel="Kind of purchase"
options={[
{ id: "normal", label: "Regular purchase" },
{ id: "foerdermittel", label: "Funded" },
{ id: "replacement", label: "Replacement" },
{ id: "investment", label: "Investment" },
]}
keyAttribute="id" valueAttribute="label"
value="purchase.requestKind" data={draft} valueOut mandatory />
// several at once, output is an array of keys
<EccRadioGroup fieldLabel="Documents attached" selectionMode="multiple"
options={["Quote", "Specification", "Approval"]} valueOut="purchase.anlagen" />
// single choice that can be cleared again
<EccRadioGroup fieldLabel="Urgency" options={["normal", "urgent"]} allowEmptySelection valueOut="purchase.dringlichkeit" />
Props
| as in Component Basics | ||
|
|
| items |
| path |
| key of an item, written to the output |
| path |
| label of an item |
| path, object | - | preselect the stored key(s) |
|
| - | default |
|
|
| radio or checkboxes |
|
|
| single mode: a second click clears the selection |
|
| - | single selection changed |
Output: the key (single) or an array of keys (multiple).
Related
super component: a subset of the basic props | |
the same options as a list | |
a single yes/no value |
On this page
- EccRadioGroup