Enum SelectionInputType
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
選取輸入類型
使用者可選取的項目格式。不同的選項支援不同類型的互動。舉例來說,使用者可以選取多個核取方塊,但只能從下拉式選單中選取一個項目。
每個選取輸入都支援一種選取類型。舉例來說,系統不支援同時使用核取方塊和切換鈕。
適用於 Google Chat 應用程式和 Google Workspace 外掛程式。
如要呼叫列舉,請呼叫其父項類別、名稱和屬性。例如
CardService.SelectionInput.CHECK_BOX
。
屬性
屬性 | 類型 | 說明 |
CHECK_BOX | Enum | 核取方塊輸入樣式。預設值。 |
RADIO_BUTTON | Enum | 圓形按鈕輸入樣式。最多只能選取一個群組中的項目。 |
DROPDOWN | Enum | 下拉式選單選取輸入樣式。 |
SWITCH | Enum | 一組開關。使用者可以開啟一或多個切換裝置。 |
MULTI_SELECT | Enum | 用於靜態或動態資料的多重選取選單。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\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. |"]]