Multiple Choice
WdCheckboxList
Applicable Scenarios
The page displays options in a tiled layout, allowing users to make multiple selections.
Basic Capabilities Description
Bind an "enum" type field. After the form container is bound to the data model, the enum-multiple selection in the model will be automatically rendered as a multiple selection component, allowing users to select multiple data items. The default selected value (when configuring, enter the option value, not the option name) and component size (effective on PC, not on mobile) can be configured.
Supports personalized configuration of titles, including title content, alignment, line break settings (when enabled, titles exceeding one line will wrap; when disabled, titles exceeding one line will display with ellipsis), title position, width, and title tooltip.

- Supports personalized configuration of options, including the tooltip below options, layout direction, and whether to display underlines on mobile devices.

Note:
- The multi-select component supports both horizontal and vertical layout directions for options, with vertical as the default. When horizontal is chosen, options will wrap automatically based on their length.
- The multi-select component supports configuring multiple default selected values.
- If a component is within a form container, its size, title alignment, position, line wrapping, and width will default to the property configuration of the form container
To learn more about form component usage scenarios, refer to the Form Common Scenario Practice Guide
Extended Scenarios Description
Generating Dynamic Option Lists via Query
Using class data as an example, configure a dynamic option list for the component.
Create a class data model with a class name field.

In the Data Management Backend, enter sample values for several classes in this model (note the data environment in the top-left corner of the backend: trial data is only available in the editor development preview and trial version applications; for production applications, formal data must be entered in advance)

In the code area at the bottom left of the editor, click the '+' to create a new WeDa data table query. After completing the configuration below, click the save button in the top right corner.
Data table: select the previously created class model.
Trigger Method: Select to automatically execute when input parameters change (executes automatically once upon page load to retrieve relevant data)
Filter conditions, sorting methods: Can be configured as needed or left blank

Click the data binding mode button "fx" on the right of the component options properties to open the expression input.
$w.query1.data?.records?.map((item) => {
return {
value: value: item._id, // use the data ID as the option value
label: label: item.bjmc // use the class name as the label displayed for the option
};
});
- After completing the above configuration, the component's option list can load and display data from the data model, achieving dynamic control of the option list.
Example
Interactive Preview
Different Types of Multiple Choice
Style API Custom Styles
#wd-page-root .wd-form-item .wd-checkbox-wrap.checkbox1 .wd-checkbox-label {
color: green;
}
#wd-page-root .wd-form-item .wd-checkbox-wrap.checkbox2 .wd-checkbox-label {
color: red;
}
Properties
External properties received by the component
Property Name | Property Identifier | Type | Description |
|---|
| Display Headlines | labelVisible | boolean | Default value: true |
| Title alignment | labelAlign | string | In the scenario, the form by default follows the title alignment configuration of the form container. |
| Line break in heading | labelWrap | boolean | If the title content is too long when closed, show one line with overflow omitted; when enabled, show with line breaks. In form scenarios, it follows the form container's title line break configuration by default. |
| Title position | layout | string | Set title display position in form component. In the scenario, it follows the title position configuration of the form container by default. |
| Title width | labelWidth | string | In the scenario, the form follows the title width configuration of the form container by default. |
| Heading Note | labelTips | string | Configure tooltip content for the heading |
| Prompt. | extra | string | Prompt content is displayed below the component after configuration. |
| Arrangement mode | direction | string | Example: "vertical" |
| Display underscore on mobile terminal | borderedH5 | boolean | After closing, the mobile terminal does not show the bottom underline Example: true |
| Status. | status | string | Example: "edit" |
| Required | required | boolean | Enable required for this component, value cannot be empty Example: false |
| Required identifier | requiredFlag | boolean | Enabled, the component will display a required asterisk tag if mandatory. Example: true |
| Required validation note | requiredMsg | string | Enable required, prompting message when component value is empty Example: "该项为必填项" |
| Bound field | name | string | The Key value of a form field is used to match the field identifier of the data model when submitting data. It must be unique within the form. |
| Title content. | label | string | Example: "标题" |
| Option | range | array | Option List Example: [ { "label": "选项1", "value": "1" }, { "label": "选项2", "value": "2" } ] |
| selected value | value | array | Default selected option Example: [] |
| Component size(PC) | size | string | Multi-option component width, takes effect on PC only Example: "" |
| Option | tipBlock | string | Example: "" |
Events
Events exposed by the component. You can listen to component events to trigger external actions
Event Name | Event Code | Event Output Parameters event.detail | Applicable Scenarios | Description |
|---|
| value change | change | object
| Compatible with all platforms | - |
Properties API
Through the Property API, you can access the internal state and property values of components. You can access internal values using$w.componentId.propertyName, such as $w.input1.value. For details, please refer to Property API
Read-only Property Name | Property Identifier | Type | Description |
|---|
| Bound field | name | string | The Key value of a form field is used to match the field identifier of the data model when submitting data. It must be unique within the form. |
| Title content. | label | string | |
| selected value | value | array | Default selected option |
| Required | required | boolean | Enable required for this component, value cannot be empty |
| Indicates whether to display | visible | boolean | Whether to display the component |
| Whether to disable | disabled | boolean | Component Disabled |
| Specify whether it is read-only or not. | readOnly | boolean | Whether the component is read-only |
| Select Item Name | selectedLabel | string | Selected Item Text Name |
| selected item | item | array | selected item object |
Method API
Through the Method API, you can programmatically trigger internal methods of components, such as submitting forms, displaying popups, etc. You can call component methods using $w.componentId.methodName, such as $w.form1.submit()
Method Name | Method Identifier | Parameters | Method Description |
|---|
| set value | setValue | array值 使用多选组件的设置值方法时,值需要为数组格式。示例:[1,2],其中1和2对应多选组件的选项值
| 通过 $w.id1.setValue("weda") 设置组件值 |
| Show/Hide Settings | setVisible | boolean显示 | Set the component to hidden via $w.id1.setVisible(false) |
| Set Disabled | setDisabled | boolean禁用 | Set the component to disabled with $w.id1.setDisabled(true) |
| Clear value | clearValue | Clear the component value with $w.id1.clearValue() | |
| Set as read-only | setReadOnly | boolean只读 | Set the component to read-only via $w.id1.setReadOnly(true) |
| Trigger validation | handleValidate | Validate the component value via $w.id1.handleValidate() | |
| Clear verification | clearValidate | Clear component validation via $w.id1.clearValidate() |
Style API
Through the Style API, you can override the styles of internal elements in components to achieve customization. For example, in the low-code editor, you can write styles for all button components using #wd-page-root .wd-btn, and control individual component styles with :scope. For detailed instructions, please refer toStyle API
Name | Class Name | Description and Examples |
|---|
| root element | .wd-checkbox-root | Outermost component element |
| H5 root element | .wd-h5-checkbox-root | Settable root element style for the H5 side |
| PC-side root element | .wd-pc-checkbox-root | Settable root element style for the PC side |
| Mini program root element | .wd-mp-checkbox-root | Settable root element style for mini program |
| Component title style | .wd-checkbox-root .wd-form-item-wrap__label | Component title element |
| form control root node style | .wd-checkbox-root .wd-form-item-wrap__control | Set form control root element style |
| multi-select control group root node style | .wd-checkbox-root .wd-checkbox-group | multi-select control group root node style |
| multi-select control single item root node style | .wd-checkbox-root .wd-checkbox-wrap | multi-select control single item root node style |
| Option style in editing status | .wd-checkbox-root .wd-checkbox-label | Option style in editing status |
| Button style in editing status (selected) | .wd-checkbox-root .is-checked .wd-checkbox-inner::after | Button style in editing status (selected) |
| Editing status - Unselected button style | .wd-checkbox-root .wd-checkbox-inner::after | Editing status - Unselected button style |
| Editing status - Button background color | .wd-checkbox-root .wd-checkbox-inner | Editing status - Button background color |
| Editing status - Verification information | .wd-checkbox-root .wd-g-text-error | Set component verification information style |
| prompt text | .wd-checkbox-root .wd-form-item__help-text | Set the text style of the component prompt |
| Disabled state - Option style | .wd-checkbox-root .is-disabled .wd-checkbox-label | Disabled state - Option style |
| Disabled state - Selected button style | .wd-checkbox-root .is-disabled.is-checked .wd-checkbox-inner::after | Disabled state - Selected button style |
| Disabled state - Unselected button style | .wd-checkbox-root .is-disabled .wd-checkbox-inner::after | Disabled state - Unselected button style |
| Disabled - Button background color | .wd-checkbox-root .is-disabled .wd-checkbox-inner | Disabled - Button background color |
| read-only status - form value style | .wd-checkbox-root .wd-form-item__readonly-value | Set component read-only status |
Version Changes
- Property Changes
- Style Changes
- widget api Changes