Selects a DropDownItem by means of the contained text- Args: value (str): Textual content of the DropDownItem that have to be selected.
(self, value)
| 2795 | self.select_by_value(value) |
| 2796 | |
| 2797 | def select_by_value(self, value): |
| 2798 | """Selects a DropDownItem by means of the contained text- |
| 2799 | |
| 2800 | Args: |
| 2801 | value (str): Textual content of the DropDownItem that have to be selected. |
| 2802 | """ |
| 2803 | self._selected_key = None |
| 2804 | self._selected_item = None |
| 2805 | for k in self.children: |
| 2806 | item = self.children[k] |
| 2807 | if item.value == value: |
| 2808 | item.attributes['selected'] = 'selected' |
| 2809 | self._selected_key = k |
| 2810 | self._selected_item = item |
| 2811 | log.debug('dropdown selected item with value %s' % value) |
| 2812 | else: |
| 2813 | if 'selected' in item.attributes: |
| 2814 | del item.attributes['selected'] |
| 2815 | |
| 2816 | def get_item(self): |
| 2817 | """ |