diff --git a/library/server/wsf_html/webcontrol/wsf_control.e b/library/server/wsf_html/webcontrol/wsf_control.e index c4a4b80e..9b24fe25 100644 --- a/library/server/wsf_html/webcontrol/wsf_control.e +++ b/library/server/wsf_html/webcontrol/wsf_control.e @@ -10,6 +10,9 @@ deferred class inherit WSF_STATELESS_CONTROL + redefine + render_tag_with_tagname + end feature @@ -62,6 +65,24 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT state_changes: JSON_OBJECT +feature -- Rendering + + render_tag_with_tagname (tag, body, attributes, css_classes_string: STRING): STRING + local + 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 + ">" + end + end + feature --EVENT HANDLING handle_callback (cname: STRING; event: STRING) diff --git a/library/server/wsf_html/webcontrol/wsf_page_control.e b/library/server/wsf_html/webcontrol/wsf_page_control.e index 89ae201c..846069b7 100644 --- a/library/server/wsf_html/webcontrol/wsf_page_control.e +++ b/library/server/wsf_html/webcontrol/wsf_page_control.e @@ -76,7 +76,7 @@ feature do create states.make control.read_state (states) - data := "
" + data := "" data.append ("") data.append ("") data.append ("") diff --git a/library/server/wsf_html/webcontrol/wsf_stateless_control.e b/library/server/wsf_html/webcontrol/wsf_stateless_control.e index 29a89d59..a6e1315d 100644 --- a/library/server/wsf_html/webcontrol/wsf_stateless_control.e +++ b/library/server/wsf_html/webcontrol/wsf_stateless_control.e @@ -51,7 +51,7 @@ feature if not css_classes_string.is_empty then l_attributes := l_attributes + " class=%"" + css_classes_string + "%"" end - Result := "<" + tag + l_attributes + Result := "<" + tag + " " + l_attributes if body.is_empty and not tag.is_equal ("textarea") then Result := Result + " />" else