Model Form Integration
Template integration with the model form framework makes enabling them much easier for your pages. All you have to do on the client-side is set the useTemplate config option on the One.model.ModelFormContainer:
SHOW.TemplateDemo = Ext.extend(One.model.ModelFormContainer, {
modelInfo: { modelLevelType:
'SHOW.Task'
},
detailViewName:
'SHOW.FullTaskDetail'
,
createActionName:
'SHOW.CreateTaskFull'
,
...
useTemplate:
true
});
When that property is set, the model form framework will automatically fetch the template data with the rest of the model form and will display the One.tpl.TemplateDisplay component in the top-right corner of the page.
Aside from that, the only difference between using templates with model form and using them with a custom page is the dataConfig is automatically saved and used to prepopulate the page in the model form framework. There is a default implementation of the onSave() callback which fetches all the field values from the page and adds them into the dataConfig object, so if you choose to create your own, you'll have to do this manually.