Redesign states and implement generated control_name
This commit is contained in:
@@ -22,19 +22,19 @@ create
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (n: STRING; c: WSF_AUTOCOMPLETION)
|
||||
make (c: WSF_AUTOCOMPLETION)
|
||||
-- Initialize with specified name and autocompletion
|
||||
do
|
||||
make_with_agent (n, agent c.autocompletion)
|
||||
make_with_agent ( agent c.autocompletion)
|
||||
if attached c.template as t then
|
||||
template := t
|
||||
end
|
||||
end
|
||||
|
||||
make_with_agent (n: STRING; c: FUNCTION [ANY, TUPLE [STRING], JSON_ARRAY])
|
||||
make_with_agent (c: FUNCTION [ANY, TUPLE [STRING], JSON_ARRAY])
|
||||
-- Initialize with specified name and autocompletion function
|
||||
do
|
||||
make_input (n, "")
|
||||
make_input ( "")
|
||||
create_json_list := c
|
||||
template := "{{=value}}"
|
||||
end
|
||||
@@ -49,10 +49,10 @@ feature -- State
|
||||
|
||||
feature -- Callback
|
||||
|
||||
handle_callback (cname: STRING; event: STRING; event_parameter: detachable STRING)
|
||||
handle_callback (cname: LIST[STRING]; event: STRING; event_parameter: detachable STRING)
|
||||
do
|
||||
Precursor {WSF_INPUT_CONTROL} (cname, event, event_parameter)
|
||||
if cname.same_string (control_name) and event.same_string ("autocomplete") then
|
||||
if cname[1].same_string (control_name) and event.same_string ("autocomplete") then
|
||||
state_changes.put (create_json_list.item ([text]), "suggestions")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,10 +19,10 @@ create
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (n, l, c: STRING)
|
||||
make (l, c: STRING)
|
||||
-- Initialize with specified control name,
|
||||
do
|
||||
make_value_control (n, "input")
|
||||
make_value_control ( "input")
|
||||
label := l
|
||||
checked_value := c
|
||||
end
|
||||
@@ -54,9 +54,9 @@ feature --Event handling
|
||||
change_event := e
|
||||
end
|
||||
|
||||
handle_callback (cname: STRING; event: STRING; event_parameter: detachable STRING)
|
||||
handle_callback (cname: LIST[STRING]; event: STRING; event_parameter: detachable STRING)
|
||||
do
|
||||
if Current.control_name.same_string (cname) and attached change_event as cevent then
|
||||
if Current.control_name.same_string (cname[1]) and attached change_event as cevent then
|
||||
if event.same_string ("change") then
|
||||
cevent.call (Void)
|
||||
end
|
||||
|
||||
@@ -28,10 +28,10 @@ create
|
||||
|
||||
feature {NONE} -- Initializaton
|
||||
|
||||
make (n: STRING)
|
||||
make
|
||||
-- Initialize with specified control name
|
||||
do
|
||||
make_multi_control (n)
|
||||
make_multi_control
|
||||
end
|
||||
|
||||
feature -- Implementation
|
||||
|
||||
@@ -19,10 +19,10 @@ create
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (n, v: STRING)
|
||||
make (v: STRING)
|
||||
-- Initialize with specified name and value
|
||||
do
|
||||
make_value_control (n, "input")
|
||||
make_value_control ( "input")
|
||||
type := "text"
|
||||
text := v
|
||||
end
|
||||
@@ -53,9 +53,9 @@ feature --Event handling
|
||||
change_event := e
|
||||
end
|
||||
|
||||
handle_callback (cname: STRING; event: STRING; event_parameter: detachable STRING)
|
||||
do
|
||||
if Current.control_name.same_string (cname) and attached change_event as cevent then
|
||||
handle_callback (cname: LIST[STRING]; event: STRING; event_parameter: detachable STRING)
|
||||
do
|
||||
if Current.control_name.same_string (cname[1]) and attached change_event as cevent then
|
||||
if event.same_string ("change") then
|
||||
cevent.call (Void)
|
||||
end
|
||||
|
||||
@@ -19,10 +19,10 @@ create
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (n, v: STRING)
|
||||
make (v: STRING)
|
||||
-- Initialize with specified control name and text
|
||||
do
|
||||
make_input (n, v)
|
||||
make_input (v)
|
||||
type := "password"
|
||||
end
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ create
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (n, t: STRING)
|
||||
make (t: STRING)
|
||||
-- Initialize with specified control name and text to be displayed in this textarea
|
||||
do
|
||||
make_input (n, t)
|
||||
make_input ( t)
|
||||
tag_name := "textarea"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user