diff --git a/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua b/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua index 7f704f5f..64b15b25 100644 --- a/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua +++ b/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua @@ -410,6 +410,21 @@ function TextValue:__init__(...) end +local Element = class(Node) +M.Element = Element + +function Element:__init__(template, ...) + Node.__init__(self, ...) + + self.default = nil + self.size = nil + self.optional = false + + self.template = template + + self.error = false +end + local Section = class(Node) M.Section = Section @@ -426,8 +441,8 @@ function Section:option(t, ...) return obj end -function Section:template(...) - local obj = Template(...) +function Section:element(...) + local obj = Element(...) self:append(obj) return obj end