Use render tag
This commit is contained in:
@@ -59,7 +59,7 @@ feature
|
||||
|
||||
render: STRING
|
||||
do
|
||||
Result := "<button data-name=%"" + control_name + "%" data-type=%"WSF_BUTTON_CONTROL%">" + generator + text + "</button>"
|
||||
Result := render_tag ( text, "")
|
||||
end
|
||||
|
||||
set_text (t: STRING)
|
||||
|
||||
@@ -73,15 +73,26 @@ feature --EVENT HANDLING
|
||||
|
||||
feature
|
||||
render_tag(body,attributes:STRING):STRING
|
||||
local
|
||||
css_class_string: STRING
|
||||
do
|
||||
Result:="<"+tag_name+" data-name=%"" + control_name + "%" data-type=%""+generator+"%" "+attributes
|
||||
css_class_string := ""
|
||||
across
|
||||
css_class as c
|
||||
loop
|
||||
css_class_string := css_class_string + " " + c.item
|
||||
end
|
||||
if not css_class_string.is_empty then
|
||||
css_class_string := " class=%"" + css_class_string + "%""
|
||||
end
|
||||
Result:="<"+tag_name+" data-name=%"" + control_name + "%" data-type=%""+generator+"%" "+attributes+css_class_string
|
||||
if not body.is_empty then
|
||||
Result:= Result + " />"
|
||||
else
|
||||
Result:= Result + " >" + body + "</"+tag_name+">"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
render: STRING
|
||||
-- Return html representaion of control
|
||||
deferred
|
||||
|
||||
@@ -61,7 +61,7 @@ feature
|
||||
|
||||
render: STRING
|
||||
do
|
||||
Result := "<input type=%"text%" data-name=%"" + control_name + "%" data-type=%"WSF_TEXT_CONTROL%" value=%"" + text + "%" />"
|
||||
Result :=render_tag("","value=%"" + text + "%"")
|
||||
end
|
||||
|
||||
set_text (t: STRING)
|
||||
|
||||
@@ -10,6 +10,9 @@ class
|
||||
inherit
|
||||
|
||||
WSF_TEXT_CONTROL
|
||||
redefine
|
||||
render
|
||||
end
|
||||
|
||||
create
|
||||
make_textarea
|
||||
@@ -21,4 +24,11 @@ feature {NONE}
|
||||
make_text (n, t)
|
||||
tag_name := "textarea"
|
||||
end
|
||||
feature
|
||||
|
||||
render: STRING
|
||||
do
|
||||
Result :=render_tag(text,"")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user