lib/YuiRestClient/Widget/SelectionBox.pm

NAME

YuiRestClient::Widget::SelectionBox - Class representing a selection box in the UI. It can be YSelectionBox

COPYRIGHT

Copyright 2020 SUSE LLC

SPDX-License-Identifier: FSFAP

AUTHORS

QE YaST <qa-sle-yast@suse.de>

SYNOPSIS

DESCRIPTION

Overview

Handles a selection box.

{
  "class" : "YSelectionBox",
  "debug_label" : "selection box title",
  "hstretch" : true,
  "icon_base_path" : "",
  "id" : "test_id",
  "items" :
  [
    {
      "label" : "selection 1",
      "selected" : true
    },
    {
      "label" : "selection 2"
    },
    {
      "label" : "selection 3"
    }
  ],
  "items_count" : 3,
  "label" : "&selection box title",
  "vstretch" : true
}

Class and object methods

select($item) - Select item in a SelectionBox object.

This action puts the item in focus (i.e highlights it), but does not check a checkbox associated with the item. The item is identified by its label.

check($item) - Check checkbox for an item in a SelectionBox object.

The item is identified by its label.

uncheck($item) - Uncheck checkbox for an item in a SelectionBox object.

The item is identified by its label.

items() - returns a map of available items in the SelectionBox object.

selected_items() - get a list of selected items

This method returns an array with all the labels of items that are selected in the current class object.