Mercurial > libervia-backend
changeset 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 | 06ff33052354 |
children | 83f9b9ff1a54 |
files | src/tools/common/template_xmlui.py |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
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):