Fix render function

This commit is contained in:
YNH Webdev
2013-09-13 01:05:35 +02:00
parent 9c65194d91
commit 6860860161

View File

@@ -11,7 +11,7 @@ inherit
WSF_STATELESS_CONTROL WSF_STATELESS_CONTROL
redefine redefine
render_tag_with_tagname render_tag
end end
feature feature
@@ -67,22 +67,23 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
feature -- Rendering feature -- Rendering
render_tag_with_tagname (tag, body, attributes, css_classes_string: STRING): STRING render_tag (body, attributes: STRING): STRING
local local
l_attributes: STRING css_classes_string: STRING
l_attributes:STRING
do do
l_attributes := attributes css_classes_string := ""
if not css_classes_string.is_empty then across
l_attributes := l_attributes + " class=%"" + css_classes_string + "%"" css_classes as c
end loop
Result := "<" + tag + " id=%"" + control_name + "%" data-name=%"" + control_name + "%" data-type=%"" + generator + "%" " + l_attributes css_classes_string := css_classes_string + " " + c.item
if body.is_empty and not tag.is_equal ("textarea") then
Result := Result + " />"
else
Result := Result + " >" + body + "</" + tag + ">"
end end
l_attributes :="id=%"" + control_name + "%" data-name=%"" + control_name + "%" data-type=%"" + generator + "%" " + attributes
Result := render_tag_with_tagname (tag_name, body, l_attributes, css_classes_string)
end end
feature --EVENT HANDLING feature --EVENT HANDLING
handle_callback (cname: STRING; event: STRING) handle_callback (cname: STRING; event: STRING)