Add comments to grid controls

This commit is contained in:
YNH Webdev
2013-09-22 14:35:26 +02:00
parent 57dd4ce259
commit f360e8a867
12 changed files with 85 additions and 72 deletions

View File

@@ -13,11 +13,10 @@ inherit
redefine
set_state,
state,
handle_callback,
render
end
feature {NONE}
feature {NONE} -- Initialization
make_repeater (n: STRING; a_datasource: WSF_DATASOURCE [G])
do
@@ -30,16 +29,17 @@ feature {NONE}
end
end
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
update
-- Send new renederd control to client on update
do
state_changes.replace (create {JSON_STRING}.make_json (render_body), "_body")
state_changes.replace (datasource.state, "datasource")
end
set_state (new_state: JSON_OBJECT)
-- Restore html from json
-- Restore datasource state from json
do
if attached {JSON_OBJECT} new_state.item ("datasource") as datasource_state then
datasource.set_state (datasource_state)
@@ -47,26 +47,22 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
end
state: JSON_OBJECT
-- Return state which contains the current html and if there is an event handle attached
-- Return state which contains the current datasource state
do
create Result.make
Result.put (datasource.state, "datasource")
end
feature --EVENT HANDLING
handle_callback (cname: STRING; event: STRING; event_parameter: detachable STRING)
do
Precursor (cname, event, event_parameter)
end
feature -- Implementation
feature -- Rendering
render_item (item: G): STRING
--Render item
deferred
end
render_body: STRING
--Render Body
do
Result := ""
across
@@ -77,6 +73,7 @@ feature -- Implementation
end
render: STRING
--Render repeater inclusive paging if paging is available
local
content: STRING
do
@@ -91,7 +88,7 @@ feature -- Implementation
Result := render_tag_with_generator_name ("WSF_REPEATER_CONTROL", content + Result, "")
end
feature
feature -- Properties
datasource: WSF_DATASOURCE [G]