Add comments

Use Precursor
This commit is contained in:
YNH Webdev
2013-08-28 22:59:24 +02:00
parent e186475a81
commit 275cc7aa21
5 changed files with 30 additions and 17 deletions

View File

@@ -14,37 +14,40 @@ feature
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
load_state (new_states: JSON_OBJECT)
local
new_state: detachable JSON_VALUE
-- Select state stored with `control_name` as key
do
new_state := new_states.item (create {JSON_STRING}.make_json (control_name))
if attached {JSON_OBJECT} new_state as new_state_obj then
if attached {JSON_OBJECT} new_states.item (create {JSON_STRING}.make_json (control_name)) as new_state_obj then
set_state (new_state_obj)
end
end
set_state (new_state: JSON_OBJECT)
-- Before we process the callback. We restore the state of control.
deferred
end
read_state (states: JSON_OBJECT)
-- Add a new entry in the `states` JSON object with the `control_name` as key and the `state` as value
do
states.put (state, create {JSON_STRING}.make_json (control_name))
end
set_state (new_state: JSON_OBJECT)
deferred
end
state: JSON_OBJECT
-- Returns the current state of the Control as JSON. This state will be transfered to the client.
deferred
end
feature --EVENT HANDLING
handle_callback (cname: STRING; event: STRING)
-- Method called if any callback recived. In this method you can route the callback to the event handler
deferred
end
feature
render: STRING
-- Return html representaion of control
deferred
end