Class: YuiRestClient::Widgets::Combobox
- Defined in:
- lib/yui_rest_client/widgets/combobox.rb
Overview
Class representing a ComboBox in the UI. It can be YComboBox.
Instance Method Summary collapse
-
#editable? ⇒ Boolean
Allows to check if combobox is editable and allows setting .
-
#items ⇒ Array<String>
Returns the list of items available to select from combobox.
-
#select(item) ⇒ Combobox
Sends action to select the item in combobox.
-
#set(value) ⇒ Combobox
Sends action to set string to the editable combobox.
-
#value ⇒ Object
Returns selected item in combobox.
Methods inherited from Base
#action, #collect_all, #debug_label, #enabled?, #exists?, #initialize, #property
Methods included from YuiRestClient::Waitable
Constructor Details
This class inherits a constructor from YuiRestClient::Widgets::Base
Instance Method Details
#editable? ⇒ Boolean
Allows to check if combobox is editable and allows setting .
90 91 92 |
# File 'lib/yui_rest_client/widgets/combobox.rb', line 90 def editable? property(:editable) == true end |
#items ⇒ Array<String>
Returns the list of items available to select from combobox.
32 33 34 |
# File 'lib/yui_rest_client/widgets/combobox.rb', line 32 def items property(:items).map { |x| x[:label] } end |
#select(item) ⇒ Combobox
Sends action to select the item in combobox. List of items can be retrieved from JSON “items”->“label” manually or by using ‘combobox(filter).items’.
43 44 45 46 |
# File 'lib/yui_rest_client/widgets/combobox.rb', line 43 def select(item) action(action: Actions::SELECT, value: item) self end |
#set(value) ⇒ Combobox
Sends action to set string to the editable combobox. To check if combobox is editable, call editable?
81 82 83 84 |
# File 'lib/yui_rest_client/widgets/combobox.rb', line 81 def set(value) action(action: Actions::ENTER_TEXT, value: value) self end |
#value ⇒ Object
Returns selected item in combobox.
70 71 72 |
# File 'lib/yui_rest_client/widgets/combobox.rb', line 70 def value property(:value) end |