Component ID Overview

   MaestroThe UI design product.  |    Form Builder  |  All versions This feature is related to all versions.

Every component on a form has a unique identifier, also known a component ID, which you can use to refer to the component. This ID is initialized when you create a component, but you can changed it at any time in the ID field on the Properties panel.

When you add a new component to a form, the ID property is assigned a default value and is highlighted automatically so that you can start typing into the field. The ID’s default value is based on the component type; for example, the default ID for a Text Field is “textField”.

You can change the component ID from this default value at any time. Changes to ID are reflected in other properties.

  • The first time you change the ID property, the Label property is updated based on the ID. The value for Label is the ID with spaces removed and converted to camel-case. For example, if you enter “firstName” as the ID of a new Text Field, Label is updated to display “First Name”. Any subsequent change to ID does not update Label. However, you can change the Label property directly if needed.
  • Every time you update the ID property, the XML Name or Full Path properties on the Integration tab are also updated to match the ID.

The screenshot below shows a partial view of the Properties pane with a new component added to a form. ID was initialized with the value “firstName”, causing Label to be updated automatically with the value “First Name”.

The screenshot below shows that Label remains as “First Name” when ID is updated to “fname”.

The ID property is also linked to the XML Name and Full Path properties. When ID changes, XML Name and/or Full Path are updated if Use Auto-generated XML Name or Use Entity XML Path on the Integration tab is selected. If these options are not selected, the XML Name and/or Full Path will not be updated automatically when ID changes but can be changed directly as required.

As you type a value into the component ID property field, Maestro checks whether there is an existing component with the same name and reports a duplicate ID if one is found. In this case, you have to change the component ID.

You can use entities in the component IDs.

In Maestro, every component has an ID property.

This ID is a unique identifier that is used to:

  1. distinguish components from one another
  2. auto-generate an XML path for the submission data
  3. programatically interact with components

By default, the ID of the component is based on the component's type. For example, the default ID for a Text Field component is "textField". If a component with that ID already exists, a number will be appended to the end of the ID.

Valid Component IDs

All component IDs must be unique. If you try to set a non-unique ID, Maestro will produce an error.

The first time you change a component's ID, the label of that component will also change. If, for instance, you change the ID of a component to "firstName", the label of the component will change to "First Name". This is only intended as a convenience though. There is no requirement that the ID and the label have a direct relationship.

A component ID can only contain word characters. This includes underscores, letters, and digits. The ID must not, however, begin with a digit. If you try to begin an ID with a digit, an underscore will be placed in front of it. These rules are a subset of the rules enforced for JavaScript variable names.

Typically, IDs are written in camel case, meaning the first word is lowercase and all subsequent words are capitalized.

These are some examples of camel case:

  • firstName
  • streetAddress
  • dateOfBirth

But this is only a convention, not a strictly enforced requirement.

IDs vs. XML Paths

By default, the ID of a component is used as the XML path for the component in the submission data.

To see an example of this:

  1. Select a component in the View pane.
  2. Open the Integration pane.
  3. If the Include in Submission Data option is disabled, enable it.

The Use Auto-Generated XML Name checkbox should be selected and the XML Name field should contain the ID of the component.

The benefit of this approach is that you don't have to worry about duplicate submission bindings. If the XML paths are based on the component IDs, they will inevitably be unique. But auto-generating the XML paths may not be appropriate when:

  1. You need the submission data to match a certain schema.
  2. You need to change the ID of a component for an already deployed form (thereby creating an inconsistency in the submission data).

Every component in Maestro has a number of different names that identify it. The table below provides details and examples.

Property Description Default Value Simple Example Long Example
Label The label is a human-readable name used to represent the field. The default value of the label is always the same as the name of the field type - but this is almost always immediately updated by the form designer. The label usually appears at the top or left of a field. In some cases, a field may only have a label (for example, the Text Display field), or it may not have a label. For a more complex element such as a header, the label may be just one of several pieces of text that are contained in the field. First name My Postal Address is the same as my Residential Address
Name Each field also has a name. The name is usually the same as the caption. The field's name is displayed in the Structure tab, as well as at the top of the Properties tab. The name is usually the same as the label. The only time you might be aware of the name is when a field's label is very long. In this case, Maestro will give the field a truncated name. First name My Postal Address is the...
ID Every widget also has an id. The id is an internal name, which is used in calculations. By default the ID is calculated from the Name. It has spaces and other prohibited JavaScript characters replaced with underscores, and truncated. You can override the default generated value and use your own, more meaningful name. first_name my_postal_address_is_the_sa
XML Name The XML name is used by Maestro to construct the XML payload for the form. The XML name will be used as the element name for this field in the XML structure. By default the XML Name is calculated from the Name. It has spaces removed, and will capitalize the individual words within the name. This naming convention more closely follows what many people use in XML Schemas. If you use the Data Mapper to bind fields to a seed file, then the XML Name will be updated accordingly. FirstName MyPostalAddressIsTheSameAs
Note

You are strongly recommended to override the default values of both the ID and XML Name of any fields which have a long or non-meaningful labels. This will assist greatly when you are writing calculations or working with the data.

Next, learn about component XML Name and Entity XML Path.