Customizing Field Labels and Locations

In this Topic

  1. Customizing Field Labels
    1. Example
  2. Customizing Field Locations and Visibility
    1. Detail Controls
    2. List Controls
    3. Accordion Controls

Several attributes for a field can be customized. You can change the label for a field, the column in which it is displayed [left (column 1) or right (column 2)], the order in which it is displayed in the column, and whether or not the field is visible on the page.

Customizing Field Labels

You can customize the field label for any entity or entity attribute in the application. To customize field labels, you must modify the business metadata on the Custom Metadata tab of the Business Metadata Summary component for the entity the field is associated with.

In the metadata text, there is a section for each field within the entity. Each field has a value for a label and in most cases, for a short label as well. The short label is used when the field is displayed in a rolling list.

Example

The example below shows the definition of the Federal Project Number field on the project entity:

 

  <EntityAttribute id="FederalProjectNumber" key="false" label="Federal Project Number" shortLabel="Fed Proj Num" type="char">

    <ValidationRules>

      <Rule type="MaxLength">

        <Arguments>

          <Argument name="MaxAllowed">40</Argument>

        </Arguments>

      </Rule>

      <Rule type="ReadOnlyAfterImport" />

    </ValidationRules>

  </EntityAttribute>

 

On the first line for the EntityAttribute, you will notice an entry for the label (Federal Project Number) and shortLabel (Federal Proj Num). Edit the default label value and click the Save button. The system displays the new custom field labels on any components where the field is visible.

Customizing Field Locations and Visibility

To change the default order in which the fields are displayed on a component, the column in which a field is displayed, or whether or not the field is visible, you must modify the presentation metadata for the component. The base metadata components cannot be edited, so a custom version will need to be created.

Follow these steps to create a custom component:

  1. On the Component Overview page, find the component you want to customize in the Base Component Overview.  

  1. Select Copy to Custom from the Actions menu on the base component row.

    The system opens the Copy to Custom Component component.

  1. Click the Metadata tab.

  2. Make your changes in the metadata text.

  3. When you have completed your changes, click the Save button.

Within the component there are many types of controls that are used to display the data. The most common control types that an agency will configure are the Detail, Accordion, or List controls.

Detail Controls

Detail controls are used to display data in one or two columns in a component. Examples of a detail control can be found on the General tabs for the Project, Proposal, or Contract Summary components. Detail controls are defined by setting the xsi:type="NewDetail" in the Control element.

Within each detail control is a list of fields on the component. For example, the Field elements for the first three fields on the ProjectDetailSummaryComponent are listed below:

 

        <Field xsi:type="Text" Id="Project.Name" Column="Left"/>

        <Field xsi:type="TextArea" Id="Project.Description" Column="Left"/>

        <Field xsi:type="TextBox" Id="Project.SpecBook" Column="Left"/>

In this example, all three fields are in the left column (Column="Left" ) and are ordered as they are listed in the presentation metadata (that is, the fields are listed in this order:

Project ID (the Name field)

Description

Spec Book

By default, most fields in an entity are visible on a detail component (the parent key and generated key fields are usually exceptions to this). Whether or not a field is displayed on the detail component is controlled by the field type "Hidden". In the example above, the Description field is visible because its field type is set to "TextArea". To prevent the Description field from being displayed on the detail component, the field type must be changed to "Hidden" as shown below:

 

        <Field xsi:type="Hidden" Id="Project.Description" Column="Left"/>

Once a field has been hidden, users cannot see the field on the detail component until the metadata file is changed to make it visible again.

If you wanted the Description field displayed on the right half of the page instead of the left, you would change the column attribute value to Right as shown below:

 

        <Field xsi:type="TextArea" Id="Project.Description" Column="Right"/>

Fields are ordered within the column on the component according to the relative order of its attribute line on the Metadata tab, in relation to the other fields' attribute lines in that column. To change the position in which a field is displayed on the component, cut that field's attribute row and paste it to the position in the list that corresponds to the position you want it to have on the component. For example, if you want the Spec Book field in the example above to be repositioned as the first field on the page instead of the third, you would cut the text of the entire Project.SpecBook attribute row and paste it above the row for the Project ID field.

List Controls

List controls are used to define rolling lists of data. Rolling lists can contain up to two rows of data. Only one of those two rows of data can contain editable fields. List controls are defined by setting the xsi:type="NewList" in the Control element.  

A sample attribute line for a list control is shown below:

 

    <InfoFields>

        <Field xsi:type="TextZoom" Id="SystemMessage.BaseMessageCode" Width="45"/>

    </InfoFields>

    <EditFields>

        <Field xsi:type="TextArea" Id="SystemMessage.BaseMessageText" Width="20"/>

        <Field xsi:type="TextArea" Id="SystemMessage.CustomMessageText" Width="20"/>

        <Field xsi:type="CheckBox" Id="SystemMessage.UseCustomMessage" Width="25"/>

        <Field xsi:type="Hidden" Id="SystemMessage.BaseMessageCode"/>

    </EditFields>

 

Each row in a rolling list can contain a row of read-only fields defined in the InfoFields element and a row of editable fields in the EditFields element.

The Width element in the field line specifies the width of the field when it is displayed in the list. Width is entered as a percentage (that is, width="20" means twenty percent), and the total of the widths for the visible columns should be less than 90 to allow room for the Action button or Delete button.

Accordion Controls

Accordion controls are used to define lists of data in a collapsible form. Entity definitions for accordions are similar to those for detail components.  Accordion controls are defined by setting the xsi:type="NewAccordion" in the Control element.

A sample attribute line for an accordion control is shown below:

 

    <HeaderFields>

        <Field Id="Point.Type" Column="Left"/>

        <Field Id="Point.Description" Column="Right"/>

    </HeaderFields>

    <DetailFields>

        <Field xsi:type="TextBox" Id="Point.Type" Column="Left"/>

        <Field xsi:type="TextArea" Id="Point.Description" Column="Right"/>

        <Field xsi:type="TextBox" Id="Point.Latitude" Column="Left"/>

        <Field xsi:type="TextBox" Id="Point.Longitude" Column="Left"/>

    </DetailFields>

When an accordion row is expanded, it will show the fields in either the left or right column just like a detail control. To change the column in which the fields are displayed, change the Column attribute to Left or Right.

Related topics:

Customizing Entities

Adding Agency Fields

Setting Custom Field Default Values

Customizing Field Labels and Locations

Creating Zero Fill Character Fields

 

Blue bar indicating the end of the topic