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