Dropdown Multi-select
WdSelectMultiple
Applicable Scenarios
Display options in a list format, allowing users to perform multiple selections.
Basic Capabilities
Option Configuration Instructions
Supports manual configuration of option lists, entering values and names

Selected Value Property Description
- The selected value property represents the component's default form value, which can be bound to variables or expressions to implement dynamic changes to the selected value.

- The selected value must be filled with the corresponding option value; entering option names is invalid.
Extended Scenarios
Generating Dynamic Option Lists via Query
Using class data as an example, configure a dynamic option list for dropdown single-select/multi-select components.
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 on the right side of the dropdown radio/dropdown multiple selection component options properties.

Click the data binding button on the right side of the variable property to bind it to $w.query1.data.records


For the label name and label value properties, select or enter the field identifier of the class name field in the data model.

After completing the above configuration, the option lists of the dropdown radio/dropdown multiple selection components can load and display data from the data model, achieving dynamic control of the option lists.


Practices for Other Scenarios
Refer to the Form Scenario Practice Guide to explore various supported scenarios and implementation solutions for forms.
Example
Interactive Preview
Component Input Status
Style API Example
#wd-page-root .wd-form-item .wd-select-multiple-select-multiple {
border-color: cyan;
color: cyan;
background-color: black;
border-width: 2px;
border-radius: 6px;
}
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 |
| Display clear button | clearable | boolean | Enabled, quick clear button is provided by Default value: true |
| Prefix text | before | string | The input box in the form displays the prefix text. In the form submission scenario, the prefix text is submitted as part of the form content to the data model. |
| suffix text | after | string | The input box in the form displays suffix text. In the scenario of form submission, the suffix text is submitted as form content to the data model together. |
| Prefix icon type | prefixType | string | Select icon type Example: "" |
| Prefix icon | prefixIcon | string | Show icon before the form input box Example: "success" |
| Prefix icon | prefixSrc | string | Set custom icon address |
| suffix icon type | suffixType | string | Select icon type Example: "fixed" |
| suffix icon | suffixIcon | string | Show icon in the form input box Example: "success" |
| suffix icon | suffixSrc | string | Set custom icon address |
| Prompt. | extra | string | The prompt content is displayed below the input box after configuration. |
| Display underscore on mobile terminal | borderedH5 | boolean | After closing, the mobile terminal does not show the bottom underline Default value: true |
| Display input border on PC | borderedPc | boolean | After closing, do not display input border on PC Default value: true |
| Status. | status | string | Example: "edit" |
| Required | required | boolean | |
| Required identifier | requiredFlag | boolean | Enabled, the component will display a required asterisk tag if mandatory. Default value: true |
| Required validation note | requiredMsg | string | 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": "选项名称", "value": "选项值" } ] |
| Option | tipBlock | string | |
| Upgrade filter | supportManyRelated | boolean | When enabled, the filter supports customizable criteria Example: false |
| Filter options | where | array | Default value: [] |
| data filter | queryCondition | object | Filter data Example: true |
| data sorting | sorter | array | 可设置数据排序规则,支持拖拽调整排序优先级,数组下标越小优先级越高。绑定数据示例:[{"orderBy":"updatedAt","orderType":"desc"}],升序传值asc,降序传值desc Example: [ { "orderBy": "updatedAt", "orderType": "desc", "label": "更新时间" } ] |
| selected value | value | array | Default selected option Default value: [] |
| Option name | selectFieldLabel | string | Default display of primary column field Example: "" |
| Display content | selectFieldType | string | Default display of primary column field Default value: "primary" |
| Custom selection auxiliary field | selectFields | array | |
| PC component dimension | size | string | Size configuration is only applicable to PC and takes effect by default in form container scenarios. |
| Placeholder text | placeholder | string | Example: "请选择" |
| supports search | searchable | boolean | Default value: true |
| Search box placeholder text | searchPlaceholder | string | Example: "搜索选项" |
| Disable frontend filtering | filterable | boolean | Filter by default based on the search bar input value. When enabled, block frontend filtering. |
| refresh button | enableRelationalRefresh | boolean | Click refresh to update the drop-down list data. The refresh button is configurable and shown in edit mode only when options come from the association field. Default value: true |
| Set button | enableRelationalSetting | boolean | Only when the option comes from an association field, the configuration button is supported and shown in edit mode. |
| Dropdown option redirect button | enableRelationOptionJump | boolean | Only when the option comes from an association field, the dropdown option redirection button is supported and shown in edit mode. It takes effect on both PC and H5. |
| new button | enableAddRelationButton | boolean | Only when the option comes from an association field, the new button is supported and shown in edit mode. It takes effect on both PC and H5. |
| Create button text | addRelationButtonText | string | Default value: "去新建" |
| Tag display | enableRelationTag | boolean | Only when the option comes from an association field, the component can be configured to show as a Tag in read-only status. It takes effect on PC/H5. Default value: true |
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 | Trigger when a user modifies a component value |
| Enter the content to search | search | object
| Compatible with all platforms | - |
| focus | focus | Compatible with all platforms | - | |
| Out of focus | blur | Mobile,PC | - | |
| Click the set button | onSettingButtonClick | Mobile,PC | - | |
| Click the New button | onAddRelationButtonClick | Mobile,PC | - | |
| Click Tag | onRelationTagClick | object
| Mobile,PC | - |
| Click Custom Association Dropdown option Redirect | onRelationOptionJump | object
| Mobile,PC | - |
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 |
| Prefix text | before | string | The input box in the form displays the prefix text. In the form submission scenario, the prefix text is submitted as part of the form content to the data model. |
| suffix text | after | string | The input box in the form displays suffix text. In the scenario of form submission, the suffix text is submitted as form content to the data model together. |
| Required | required | boolean | |
| 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 | object
| 通过 $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-select-multiple-root | Outermost component element |
| H5 root element | .wd-h5-select-multiple-root | Settable root element style for the H5 side |
| PC-side root element | .wd-pc-select-multiple-root | Settable root element style for the PC side |
| Mini program root element | .wd-mp-select-multiple-root | Settable root element style for mini program |
| Component title style | .wd-select-multiple-root .wd-form-item-wrap__label | Component title element |
| form control root node style | .wd-select-multiple-root .wd-form-item-wrap__control | Set form control root element style |
| 编辑态-选择框样式 | .wd-select-multiple-root .wd-form-input-wrap | Component border, margin style, background color, font size, font color |
| 编辑态-选择框样式(获取焦点) | .wd-select-multiple-root .wd-form-input-wrap.is-focused | 编辑态-选择框样式(获取焦点) |
| Editing status - Placeholder text style | .wd-select-multiple-root .select-multiple__placeholder div, .wd-select-multiple-root input::placeholder, .wd-select-multiple-root .weui-input__placeholder | Set placeholder text style |
| Editing status - Verification information | .wd-select-multiple-root .wd-g-text-error | Set component verification information style |
| prompt text | .wd-select-multiple-root .wd-form-item__help-text | Set the text style of the component prompt |
| 禁用态-选择框样式 | .wd-select-multiple-root .wd-form-input-wrap.is-disabled | Component disabled style |
| read-only status - form value style | .wd-select-multiple-root .wd-form-item__readonly-value | Set component read-only status |
| Prefix text style | .wd-select-multiple-root .wd-form-input-group__addon-left | Set component prefix text style |
| Suffix text style | .wd-select-multiple-root .wd-form-input-group__addon-right | Set component suffix text style |
| Mobile terminal drop-down list options | .wd-select-modal .wd-select-list .wd-select-list-item | Set mobile terminal dropdown menu style |
Version Changes
1. Standardized Component Upgrade
- Property Changes
- Style Changes
- widget api Changes
2. feature upgrade
After upgrading to component version 3.15, the Dropdown Single/Multi Select components with bound associations in forms now support data sorting, feature an enhanced filter, and offer case-insensitive search.
- Queries are sorted in descending order by update time by default.
- After clicking to upgrade the filter, if filtering rules were previously configured, they need to be reconfigured.
- Searches are case-insensitive by default.
