11
|
1 [%
|
|
2 BLOCK INIT;
|
|
3 document.dojo.modules.push("dijit/form/Form");
|
|
4 END;
|
|
5
|
|
6 FormResult = import('IMPL::Web::View::FormResult');
|
|
7 Metadata = import('IMPL::Web::View::Metadata::FormMeta');
|
|
8
|
|
9 UNLESS is(model,FormResult);
|
|
10 THROW form 'The form result is required';
|
|
11 END;
|
|
12
|
|
13 # defaults
|
|
14 content = layout.content || 'form/group';
|
|
15 enctype = enctype || 'application/x-www-form-urlencoded';
|
|
16 method = method || 'POST';
|
|
17 formMeta = Metadata.GetMetadataForModel(model.node, errors = model.errors, nodes = [model.node]);
|
|
18 %]
|
|
19 <form data-dojo-type="dijit/form/Form" class="form-control" method="$method" [% IF action %]action="$action" [% END %] enctype="$enctype">
|
|
20 [% display_model(formMeta, content, layout.args) %]
|
|
21 </form> |