summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2016-01-23 17:34:37 +0100
committerJo-Philipp Wich <jow@openwrt.org>2016-01-23 17:34:53 +0100
commit61239741d8a6cb9888fb379ac3e00fdb6adcc3c8 (patch)
tree1366d53dedaa14f9aced880fd2a8cfe93958d4c1
parent8d451c77c1ced9229c829af1d069fde05c436117 (diff)
luci-base: fix initialization of MultiValue options
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-rw-r--r--modules/luci-base/luasrc/cbi.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/modules/luci-base/luasrc/cbi.lua b/modules/luci-base/luasrc/cbi.lua
index 4dc1f2abad..2184395039 100644
--- a/modules/luci-base/luasrc/cbi.lua
+++ b/modules/luci-base/luasrc/cbi.lua
@@ -1623,16 +1623,16 @@ function ListValue.__init__(self, ...)
AbstractValue.__init__(self, ...)
self.template = "cbi/lvalue"
- self.keylist = {}
- self.vallist = {}
- self.deplist = {}
self.size = 1
self.widget = "select"
+
+ self:reset_values()
end
function ListValue.reset_values(self)
self.keylist = {}
self.vallist = {}
+ self.deplist = {}
end
function ListValue.value(self, key, val, ...)
@@ -1667,11 +1667,10 @@ function MultiValue.__init__(self, ...)
AbstractValue.__init__(self, ...)
self.template = "cbi/mvalue"
- self.keylist = {}
- self.vallist = {}
-
self.widget = "checkbox"
self.delimiter = " "
+
+ self:reset_values()
end
function MultiValue.render(self, ...)
@@ -1685,6 +1684,7 @@ end
function MultiValue.reset_values(self)
self.keylist = {}
self.vallist = {}
+ self.deplist = {}
end
function MultiValue.value(self, key, val)
@@ -1759,8 +1759,7 @@ function DynamicList.__init__(self, ...)
AbstractValue.__init__(self, ...)
self.template = "cbi/dynlist"
self.cast = "table"
- self.keylist = {}
- self.vallist = {}
+ self:reset_values()
end
function DynamicList.reset_values(self)