Enum SelectionInputType
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
SelectionInputType
Định dạng của các mục mà người dùng có thể chọn. Các tuỳ chọn khác nhau hỗ trợ các loại tương tác khác nhau. Ví dụ: người dùng có thể chọn nhiều hộp đánh dấu, nhưng chỉ có thể chọn một mục trong trình đơn thả xuống.
Mỗi phương thức nhập lựa chọn hỗ trợ một loại lựa chọn. Ví dụ: không hỗ trợ việc kết hợp hộp đánh dấu và nút chuyển.
Có sẵn cho các ứng dụng Google Chat và tiện ích bổ sung của Google Workspace.
Để gọi một enum, bạn gọi lớp mẹ, tên và thuộc tính của enum đó. Ví dụ:
CardService.SelectionInput.CHECK_BOX
.
Thuộc tính
Thuộc tính | Loại | Mô tả |
CHECK_BOX | Enum | Kiểu nhập hộp đánh dấu. Mặc định. |
RADIO_BUTTON | Enum | Kiểu nhập nút chọn. Bạn chỉ có thể chọn tối đa một mục trong nhóm. |
DROPDOWN | Enum | Kiểu nhập lựa chọn trình đơn thả xuống. |
SWITCH | Enum | Một tập hợp các nút chuyển. Người dùng có thể bật một hoặc nhiều nút chuyển. |
MULTI_SELECT | Enum | Trình đơn đa lựa chọn cho dữ liệu tĩnh hoặc động. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eSelectionInputType\u003c/code\u003e dictates how users interact with selectable items, such as choosing single or multiple options through checkboxes, radio buttons, dropdowns, switches, or multi-select menus.\u003c/p\u003e\n"],["\u003cp\u003eEach selection input element supports a single selection type, and combining different types like checkboxes and switches within the same element is not allowed.\u003c/p\u003e\n"],["\u003cp\u003eThis feature is available for use in Google Chat apps and Google Workspace Add-ons.\u003c/p\u003e\n"],["\u003cp\u003eTo specify a selection type, use the \u003ccode\u003eCardService.SelectionInput\u003c/code\u003e enum followed by the desired property, for instance, \u003ccode\u003eCardService.SelectionInput.CHECK_BOX\u003c/code\u003e for checkboxes.\u003c/p\u003e\n"]]],["Users can select items in various formats, including `CHECK_BOX`, `RADIO_BUTTON`, `DROPDOWN`, `SWITCH`, and `MULTI_SELECT`. Each selection input supports only one style, and mixing styles is unsupported. Checkboxes and switches allow multiple selections, while radio buttons and dropdowns are limited to single selections. `MULTI_SELECT` is used for multiselect options. This is applicable to Google Chat apps and Google Workspace add-ons. Each selection style can be called by it's parent class, name and property.\n"],null,["# Enum SelectionInputType\n\nSelectionInputType\n\nThe format of the items that users can select. Different options support different types of\ninteractions. For example, users can select multiple checkboxes, but can only select one item\nfrom a dropdown menu.\n\nEach selection input supports one type of selection. Mixing checkboxes and switches, for\nexample, isn't supported.\n\nAvailable for Google Chat apps and Google Workspace add-ons.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nCardService.SelectionInput.CHECK_BOX`. \n\n### Properties\n\n| Property | Type | Description |\n|----------------|--------|--------------------------------------------------------------------------|\n| `CHECK_BOX` | `Enum` | Checkbox input style. Default. |\n| `RADIO_BUTTON` | `Enum` | Radio button input style. At most one item in the group can be selected. |\n| `DROPDOWN` | `Enum` | Dropdown menu selection input style. |\n| `SWITCH` | `Enum` | A set of switches. Users can turn on one or more switches. |\n| `MULTI_SELECT` | `Enum` | A multiselect menu for static or dynamic data. |"]]