Fixed various Unicode text handling.

Moved example folder inside the library, and renamed it "demo"
Improved example code.
This commit is contained in:
2014-04-22 16:36:29 +02:00
parent cc7d268610
commit 3c8dc0a9e1
47 changed files with 233 additions and 98 deletions

View File

@@ -163,7 +163,7 @@ feature
if items_changed then
new_state := state
create sub_state.make
read_subcontrol_state (sub_state)
add_sub_controls_states_to (sub_state)
new_state.put (sub_state, "newstate")
new_state.put_string (render, "render")
states.put (new_state, control_name)

View File

@@ -209,7 +209,7 @@ feature -- Validation
-- Set the error message that will be displayed upon failure of client side validation
do
error := e
state_changes.replace (create {JSON_STRING}.make_json (e), "error")
state_changes.replace (create {JSON_STRING}.make_json_from_string_32 (e), "error")
ensure
error_set: error.same_string (e)
end

View File

@@ -78,25 +78,27 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
full_state: WSF_JSON_OBJECT
-- Read states in subcontrols
local
controls_state: WSF_JSON_OBJECT
l_state: WSF_JSON_OBJECT
do
Result := Precursor
create controls_state.make
read_subcontrol_state (controls_state)
Result.put (controls_state, "controls")
create l_state.make
add_sub_controls_states_to (l_state)
Result.put (l_state, "controls")
end
read_subcontrol_state (controls_state: JSON_OBJECT)
-- Read add subcontrol state in to the controls_state json object.
-- If the subcontrol is a stateless multicontrol x. We add the state of the subcontrols of x directly to controls_state. (Stateless multi controls do not add a hierarchy level)
add_sub_controls_states_to (a_controls_state: JSON_OBJECT)
-- Read add subcontrol state in to the `a_controls_state' json object.
-- If the subcontrol is a stateless multicontrol x,
-- the states of the subcontrols of x are directly added to `a_controls_state'.
-- (Stateless multi controls do not add a hierarchy level)
do
across
controls as c
loop
if attached {WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]} c.item as mcont then
mcont.read_subcontrol_state (controls_state)
mcont.add_sub_controls_states_to (a_controls_state)
elseif attached {WSF_CONTROL} c.item as cont then
controls_state.put (cont.full_state, cont.control_name)
a_controls_state.put (cont.full_state, cont.control_name)
end
end
end

View File

@@ -80,7 +80,7 @@ feature -- Implementation
event := get_parameter ("event")
event_parameter := get_parameter ("event_parameter")
if attached event and attached event_control_name and attached control then
if not event.is_equal ("uploadfile") then
if not event.same_string_general ("uploadfile") then
create states.make_empty
request.read_input_data_into (states)
create json_parser.make_parser (states)