Module: check_mk
Branch: master
Commit: 960155e8244a8519da6878453177fc2578813d8a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=960155e8244a85…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 18 13:58:49 2014 +0100
Another fix for ListOf valuespecs in complain phase
---
web/htdocs/valuespec.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 4abd944..5b62e2d 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -837,7 +837,7 @@ class ListOf(ValueSpec):
# Render reference element for cloning
html.write('<table style="display:none"
id="%s_prototype">' % varprefix)
html.write('<tr><td class=vlof_buttons>')
- html.hidden_field(varprefix + "_indexof_" + self._magic, "")
# reconstruct order after moving stuff
+ html.hidden_field(varprefix + "_indexof_" + self._magic, "",
add_var=True) # reconstruct order after moving stuff
self.del_button(varprefix, self._magic)
if self._movable:
self.move_button(varprefix, self._magic, "up")
@@ -870,7 +870,7 @@ class ListOf(ValueSpec):
for nr, v in enumerate(value):
html.push_transformation(lambda x: x.replace(self._magic, str(nr+1)))
html.write('<tr><td class=vlof_buttons>')
- html.hidden_field(varprefix + "_indexof_%d" % (nr+1), "")
# reconstruct order after moving stuff
+ html.hidden_field(varprefix + "_indexof_%d" % (nr+1), "",
add_var=True) # reconstruct order after moving stuff
self.del_button(varprefix, nr+1)
if self._movable:
self.move_button(varprefix, self._magic, "up") # visibility
fixed by javascript