summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/luasrc/cbi.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-07-30 16:05:12 +0000
committerSteven Barth <steven@midlink.org>2009-07-30 16:05:12 +0000
commitd7a90e994a1aa214e881c06e7e5d0a3f272a63ce (patch)
treefdabfcfc0677aab8727d5294c14d5e2959ea893e /libs/cbi/luasrc/cbi.lua
parent12400496cc4a15fe1e7afbe0795f9ab3f4207790 (diff)
Fix delegators
Diffstat (limited to 'libs/cbi/luasrc/cbi.lua')
-rw-r--r--libs/cbi/luasrc/cbi.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index f3c481cf84..3a687e5aa5 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -286,6 +286,11 @@ function Template.render(self)
luci.template.render(self.template, {self=self})
end
+function Template.parse(self, readinput)
+ self.readinput = (readinput ~= false)
+ return Map.formvalue(self, "cbi.submit") and FORM_DONE or FORM_NODATA
+end
+
--[[
Map - A map describing a configuration file
@@ -499,6 +504,7 @@ function Delegator.__init__(self, ...)
self.defaultpath = {}
self.pageaction = false
self.readinput = true
+ self.allow_reset = false
self.allow_back = false
self.allow_finish = false
self.template = "cbi/delegator"
@@ -573,8 +579,10 @@ function Delegator.parse(self, ...)
newcurrent = self:get_next(self.current)
end
end
-
- if not newcurrent or not self:get(newcurrent) then
+
+ if not Map.formvalue(self, "cbi.submit") then
+ return FORM_NODATA
+ elseif not newcurrent or not self:get(newcurrent) then
return FORM_DONE
else
self.current = newcurrent