Redesign states and implement generated control_name

This commit is contained in:
YNH Webdev
2013-11-08 00:03:02 +01:00
parent c9102af0aa
commit 86339d8163
33 changed files with 433 additions and 153 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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