luci-base: fix initialization of MultiValue options

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
Jo-Philipp Wich 2016-01-23 17:34:37 +01:00
parent 8d451c77c1
commit 61239741d8

View file

@ -1623,16 +1623,16 @@ function ListValue.__init__(self, ...)
AbstractValue.__init__(self, ...) AbstractValue.__init__(self, ...)
self.template = "cbi/lvalue" self.template = "cbi/lvalue"
self.keylist = {}
self.vallist = {}
self.deplist = {}
self.size = 1 self.size = 1
self.widget = "select" self.widget = "select"
self:reset_values()
end end
function ListValue.reset_values(self) function ListValue.reset_values(self)
self.keylist = {} self.keylist = {}
self.vallist = {} self.vallist = {}
self.deplist = {}
end end
function ListValue.value(self, key, val, ...) function ListValue.value(self, key, val, ...)
@ -1667,11 +1667,10 @@ function MultiValue.__init__(self, ...)
AbstractValue.__init__(self, ...) AbstractValue.__init__(self, ...)
self.template = "cbi/mvalue" self.template = "cbi/mvalue"
self.keylist = {}
self.vallist = {}
self.widget = "checkbox" self.widget = "checkbox"
self.delimiter = " " self.delimiter = " "
self:reset_values()
end end
function MultiValue.render(self, ...) function MultiValue.render(self, ...)
@ -1685,6 +1684,7 @@ end
function MultiValue.reset_values(self) function MultiValue.reset_values(self)
self.keylist = {} self.keylist = {}
self.vallist = {} self.vallist = {}
self.deplist = {}
end end
function MultiValue.value(self, key, val) function MultiValue.value(self, key, val)
@ -1759,8 +1759,7 @@ function DynamicList.__init__(self, ...)
AbstractValue.__init__(self, ...) AbstractValue.__init__(self, ...)
self.template = "cbi/dynlist" self.template = "cbi/dynlist"
self.cast = "table" self.cast = "table"
self.keylist = {} self:reset_values()
self.vallist = {}
end end
function DynamicList.reset_values(self) function DynamicList.reset_values(self)