diff options
author | Steven Barth <steven@midlink.org> | 2009-03-07 11:30:41 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2009-03-07 11:30:41 +0000 |
commit | ad57125f4132bef88ff0d2b4e34281ff812dc08b (patch) | |
tree | f040d7d24f0b438ad102883ade02b18317b26999 /libs/cbi/luasrc/cbi.lua | |
parent | eb6f9c6192343285ac4a630c63512f64b63010a6 (diff) |
Allow combination of SimpleForms as Forms into pages with Maps
Allow subsequent changes of Table data
Diffstat (limited to 'libs/cbi/luasrc/cbi.lua')
-rw-r--r-- | libs/cbi/luasrc/cbi.lua | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index 275c3f3c36..b6ccc54806 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -644,6 +644,13 @@ function SimpleForm.get_scheme() end +Form = class(SimpleForm) + +function Form.__init__(self, ...) + SimpleForm.__init__(self, ...) + self.embedded = true +end + --[[ AbstractSection @@ -814,15 +821,16 @@ Table = class(AbstractSection) function Table.__init__(self, form, data, ...) local datasource = {} + local tself = self datasource.config = "table" - self.data = data + self.data = data or {} datasource.formvalue = Map.formvalue datasource.formvaluetable = Map.formvaluetable datasource.readinput = true function datasource.get(self, section, option) - return data[section] and data[section][option] + return tself.data[section] and tself.data[section][option] end function datasource.submitstate(self) @@ -862,6 +870,10 @@ function Table.cfgsections(self) return sections end +function Table.update(self, data) + self.data = data +end + --[[ |