Module: check_mk
Branch: master
Commit: c06894c43d1c9d9a4997e394e6c2e42802314fe4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c06894c43d1c9d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Oct 7 11:21:40 2014 +0200
ListChoice: add hidden variable, make filled-in detection simpler
---
web/htdocs/valuespec.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index dbdde99..b32705f 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1421,6 +1421,8 @@ class ListChoice(ValueSpec):
html.checkbox("%s_%d" % (varprefix, nr), key in value, label =
title)
html.write("</td>")
html.write("</tr></table>")
+ # Make sure that at least one variable with the prefix is present
+ html.hidden_field(varprefix, "1")
def value_to_text(self, value):
self.load_elements()