webmcp
diff framework/env/ui/form.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 | 36ebcae1cde3 |
line diff
1.1 --- a/framework/env/ui/form.lua Fri Feb 12 18:40:22 2010 +0100 1.2 +++ b/framework/env/ui/form.lua Fri Feb 19 16:43:29 2010 +0100 1.3 @@ -17,7 +17,14 @@ 1.4 ok = { ... }, -- routing when "ok" is returned by the called action 1.5 error = { ... }, -- routing when "error" is returned by the called action 1.6 ... = { ... } -- routing when "..." is returned by the called action 1.7 - } 1.8 + }, 1.9 + partial = { -- parameters for partial loading, see below 1.10 + module = module, 1.11 + view = view, 1.12 + id = id, 1.13 + params = params, 1.14 + target = target 1.15 + }, 1.16 content = function() 1.17 ... -- code creating the contents of the form 1.18 end 1.19 @@ -25,6 +32,10 @@ 1.20 1.21 This functions creates a web form, which encloses the content created by the given 'content' function. When a 'record' is given, ui.field.* helper functions will be able to automatically determine field values by using the given record. If 'read_only' is set to true, then a call of ui.submit{...} will be ignored, and ui.field.* helper functions will behave differently. 1.22 1.23 +When passing a table as "partial" argument, AND if partial loading has been enabled by calling ui.enable_partial_loading(), then ui._partial_load_js is 1.24 +used to create an onsubmit event. The "partial" setting table is passed to ui._partial_load_js as first argument. See ui._partial_load_js(...) for 1.25 +further documentation. 1.26 + 1.27 --]]-- 1.28 1.29 local function prepare_routing_params(params, routing, default_module)