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