Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column

A control template is a control that was published by the form designer so that it can be reused in other forms and by other designers within the same tenant. You typically want to publish control templates when you create complex control with sophisticated layouts, field patterns, business rules, etc., and want to reuse that work in another form or share it with another form designer. You also may consider using control templates when you need to split the work among a number of form designers, where each designer is responsible for creating a subsection of a complex form and another designer is responsible for assembling these control templates into a final form or flowworkflow.

Image Modified

Click Control Templates for Common Rules to see examples of common custom controls.

Column
width240px

On this page:

Table of Contents
maxLevel1

...

Note

Each individual designer will have their own Custom tab with their own set of favorite control templates.

...

Control Template Types

There are two types of control templates that you can create in  – modifiable templates and read-only templates. In some cases may you want to publish a control template and allow them to be completely modified when used in other forms. These modifiable control templates are basically a starting point to a slightly or entirely different control at the discretion of the designer using it. Note that by changing the name of a control, you may break rules published with the control. In other cases, you may want to publish read-only control templates. A designer using a read-only control will not be able to remove nested controls nor change any properties that affect the underlying data binding (e.g., the name property). The designer can still change other UI-related properties such as styles and labels, and rearrange any nested controls on read-only templates.

...

There is small difference between these two ways of publishing controls, though. When clicking the Publish Control Template link, you are only publishing the control as a template, but when you drag & drop you are also adding the published control to the Custom tab, in one shot.

Image Modified

Next, you will see the Publish Control Template dialog where you can enter a name and description for this template, a category, and any number of comma or space-separated tags.  See the Manage Control Categories topic for instructions for adding or removing control template categories.

Image Modified

Click Submit and you will see a confirmation page that once closed will refresh the page. If you used the drag & drop approach above, you should see the published control automatically added to your Custom pane.

Image Modified

Note

The image, video, table, upload and pagebreak controls are not allowed in a custom control. You will see this message if you try to publish a section that contains any of these controls: "Sorry - the custom control contains a control that is not allowed in the custom palette."

Publishing Controls with Rules

...

When the above conditions are met, the Publish Control Template dialog will list the candidate rules (see next screenshot) allowing you to select the ones you want to publish with the control. Note that as soon as at least one rule is selected the read-only checkbox will also be selected: you can only publish controls with rules in read-only mode. Since it is not possible to edit rules after the control is published, this restriction exists to make sure that no changes that could break the rules will be allowed when using the template.

Image Modified 

Prefix Property

...

For example, let's say you have a Section control named Section 67 which contains a text control named a. There is a rule attached to populate a with the text "sweet" when the form loads. You publish the control as read-only and carry the rule along with it. Then you create a new form and drag Section 67 into your new form three times. The Section control name of the of the first instance will not contain the prefix. However, the second and third instances will include the prefix. Now you can write a rule that will populate the control named a in the second and third instances using the assigned prefix.

Image Modified

The assigned prefixes will show in the Form OutlineThis is helpful when writing the rules for the second and third instances.

Image Modified

The rule shown populates the control named a in the second copy of the custom control with the word "sour" and the third copy with the text "sweet and sour" respectively whem the form loads. Notice the a controls in the second and third copies are referenced with the prefix in the rule.

Code Block
if(form.load)
{
a.value='sweet';
}
if (C196a.value.length > 0) {
C196a.value = 'sour';
}
if (C198a.value.length > 0) {
C198a.value ='sweet and sour';
}

Image Modified

You can edit the Prefix property but  will not allow you to make it non-unique.

...

You can add control templates to the Custom pane by clicking the Search link found there. This will show the Search Control Templates dialog where you can search for the template you are looking for.

Image Modified

This search dialog will show, by default, the first 10 templates ordered by the date when the control was published. You can then page through the templates by clicking Next or Previous.

...