view shared_view/includes/dojo/form.tt @ 12:d9551c7e7101

improved dox library
author sergey
date Fri, 16 May 2014 16:47:50 +0400
parents 573272ec604b
children
line wrap: on
line source

[%
	BLOCK INIT;
		document.dojo.modules.push("dijit/form/Form");
	END;
	
	FormResult = import('IMPL::Web::View::FormResult');
	Metadata = import('IMPL::Web::View::Metadata::FormMeta');
	
	UNLESS is(model,FormResult);
		THROW form 'The form result is required';
	END;
	
	# defaults
	content = layout.content || 'form/group';
	enctype = enctype || 'application/x-www-form-urlencoded';
	method = method || 'POST';
	formMeta = Metadata.GetMetadataForModel(model.node, errors = model.errors, nodes = [model.node]);
 %]
<form data-dojo-type="dijit/form/Form" class="form-control" method="$method" [% IF action %]action="$action" [% END %] enctype="$enctype">
	[% display_model(formMeta, content, layout.args) %]
</form>