diff --git a/src/tools/xml_tools.py b/src/tools/xml_tools.py index bacb7615..b365f9ca 100644 --- a/src/tools/xml_tools.py +++ b/src/tools/xml_tools.py @@ -896,6 +896,10 @@ class StringWidget(InputWidget): value_elt.appendChild(text) self.elem.appendChild(value_elt) + @property + def value(self): + return self.elem.firstChild.firstChild.wholeText + class PasswordWidget(StringWidget): type = 'password' @@ -1020,6 +1024,13 @@ class ListWidget(InputWidget): def setStyle(self, style): self.setStyles([style]) + @property + def value(self): + """Return the value of first selected option""" + for child in self.elem.childNodes: + if child.tagName == u'option' and child.getAttribute(u'selected') == u'true': + return child.getAttribute(u'value') + return u'' class JidsListWidget(InputWidget): """A list of text or jids where elements can be added/removed or modified"""