webmcp
view framework/env/ui/partial.lua @ 12:f3d3203cd2e4
Documentation for partial loading added
NOTE: Previous changeset d76a8857ba62 also modified behaviour of ui.script: Scripts containing "]]>" are now rejected to avoid ambiguities
NOTE: Previous changeset d76a8857ba62 also modified behaviour of ui.script: Scripts containing "]]>" are now rejected to avoid ambiguities
author | jbe |
---|---|
date | Fri Feb 19 16:43:29 2010 +0100 (2010-02-19) |
parents | d76a8857ba62 |
children |
line source
1 --[[--
2 ui.partial{
3 module = module, -- module to be used to reload inner contents
4 view = view, -- view to be used to reload inner contents
5 id = id, -- id to be used to reload inner contents
6 params = params, -- params to be used to reload inner contents
7 target = target, -- id of HTML element containing contents to be replaced
8 content = function()
9 ...
10 end
11 }
13 Calling this function declares that the inner contents can be requested
14 directly via the given module, view, id and params. The parameter "target"
15 specifies the id of the HTML element, which should be replaced when
16 reloading partially.
18 The function has an effect on inner calls of ui.link{..., partial = {...}}
19 and ui.form{..., partial = {...}}.
21 --]]--
23 function ui.partial(args)
24 local old_state = ui._partial_state
25 ui._partial_state = table.new(args)
26 ui._partial_state.param_name_hash = {}
27 if args.param_names then
28 ui.add_partial_param_names(args.param_names)
29 end
30 args.content()
31 ui._partial_state = old_state
32 end