[checkmk-commits] Check_MK Git: check_mk: OptionalDropdownChoice: fix rendering of explicit value

Mathias Kettner mk at mathias-kettner.de
Thu Apr 18 10:27:51 CEST 2013


Module: check_mk
Branch: master
Commit: 60039cf96455efe9c9bbda3e585b8c70c3b1cb08
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=60039cf96455efe9c9bbda3e585b8c70c3b1cb08

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Thu Apr 18 10:27:47 2013 +0200

OptionalDropdownChoice: fix rendering of explicit value

---

 web/htdocs/valuespec.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index daf92f5..1b66856 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1296,7 +1296,12 @@ class OptionalDropdownChoice(ValueSpec):
         html.write('<span id="%s_ex" style="white-space: nowrap; %s">' % (
             varprefix, not div_is_open and "display: none;" or ""))
         html.write(" ")
-        self._explicit.render_input(varprefix + "_ex", value)
+
+        if defval == "other":
+            input_value = value
+        else:
+            input_value = self._explicit.default_value()
+        self._explicit.render_input(varprefix + "_ex", input_value)
         html.write("</span>")
 
     def value_to_text(self, value):



More information about the checkmk-commits mailing list