Default template

Description

The Default template property helps you to create a general HTML template for a form view control. Before adding a template, the FormView simply appears as raw HTML. As such it is fairly uninteresting. Adding a template can give a FormView control the same styling that other controls have. You can also add your own general HTML styling here.

The Default template property
The Default template property

If you want to style a specific Field in the Form View you should go to the Form Layout pane, highlight the field that you want to stylize, and click the 'Template property' on the Form Properties pane of the Form View Builder. For a visual explanation watch this video.

Sample template Options

Clicking the "Insert sample template" button will show a number of predefined templates to use with the FormView control.

"Insert sample template" options
"Insert sample template" options

The default template will take on the CSS of whatever the Style name property setting for the project is. You can set the Style name property on the UX Properties page under UX Properties. Here are a few sample templates set to different style name settings.

Field value only - no label (Style name = AndroidLight)
Field value only - no label (Style name = AndroidLight)
Field with label above (Style name = GrBlue)
Field with label above (Style name = GrBlue)
Field with label above - label size 75% of Data Size (Style name = iOS7)
Field with label above - label size 75% of Data Size (Style name = iOS7)

Insert placeholder

If you are designing your own default template for the Form View control you can add placeholders to your HTML to design the look of the fields, field labels, field name, fieldError, and field name path.

Placeholder options
Placeholder options

You can add styling to a placeholders by placing the placeholder inside a div tag and then giving the div a style.

<div class="{dialog.style}DialogLabel" style="font-size: 75%">{*fieldLabel}</div>
<div class="{dialog.style}Edit">{*field}</div>
{*fieldError}
Result
Result

Templates also support using client-side template formatting directives to format data to display dates, numbers, or transform text into upper or lower case when defining the template.

{*field:number('#,##0.00')}

See the "See Also" below for more information on formatting directives.

See Also