diff src/tools/common/template_xmlui.py @ 2455:7b02372f8734

template (xmlui): added labels property in ValueWidget (actually return values) and values property in OptionsWidget
author Goffi <goffi@goffi.org>
date Mon, 04 Dec 2017 00:45:07 +0100
parents 49884c579266
children 0046283a285d
line wrap: on
line diff
--- a/src/tools/common/template_xmlui.py	Thu Nov 30 21:00:24 2017 +0100
+++ b/src/tools/common/template_xmlui.py	Mon Dec 04 00:45:07 2017 +0100
@@ -53,6 +53,13 @@
     def values(self):
         return [self.value]
 
+    @property
+    def labels(self):
+        # helper property, there is not label for ValueWidget
+        # but using labels make rendering more easy (one single method to call)
+        # values are actually returned
+        return [self.value]
+
 
 class InputWidget(ValueWidget):
 
@@ -71,7 +78,8 @@
 
     @property
     def values(self):
-        return self.selected
+        for value, label in self.items:
+            yield value
 
     @property
     def labels(self):