From 68608601616001673c6b66273bd1ca336821fe84 Mon Sep 17 00:00:00 2001 From: YNH Webdev Date: Fri, 13 Sep 2013 01:05:35 +0200 Subject: [PATCH] Fix render function --- .../server/wsf_html/webcontrol/wsf_control.e | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/library/server/wsf_html/webcontrol/wsf_control.e b/library/server/wsf_html/webcontrol/wsf_control.e index 9b24fe25..03099103 100644 --- a/library/server/wsf_html/webcontrol/wsf_control.e +++ b/library/server/wsf_html/webcontrol/wsf_control.e @@ -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 + "" + 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)