Previous Topic: Select Boxes and OptionsNext Topic: How to Create a Dynamic Table


Create a Static Table

You can create a static table to enter structured data into a form. A static table is a type of container, like a field set, that can contain certain elements of a form. You can use the columns in the table to organize the data from each type of element. In contrast to a dynamic table, a static table consists of fixed data that you specify manually.

Follow these steps:

  1. Edit or create the form in which you want to add the table. Expand the form.
  2. Do the following to add the table element to the form:
    1. (Optional) Create a field set to contain the table.
    2. Expand the System folder, drag the Table element, and drop it on the form. If applicable, drop the table onto the field set that you created in the previous step.
    3. Specify an _id value for the table and save the form.
  3. Do the following to add an element to the table:
    1. Expand the table to display the Row field.
    2. Drag the element that you want from the System folder and drop it on the Row field. You can drag-and-drop the following elements:
      • Date Time field
      • Label
      • Select field whose Multi-Select attribute is set to false. This setting allows only a single selection.
      • Spinner
      • Text

      The name of the element that you drag-and-drop becomes the name of the first column. For example, if you drag-and-drop a Date element, the name of the first column becomes Date.

      Similarly, the data that you enter in the column must match its element. For example, in a Date column, you can enter only dates.

    3. Specify an _id value for the column and save the form.

      Note: After you save the form, you can optionally rename the element that you dragged and dropped. If you rename the element, the name of the column changes accordingly. For example, if you rename the element to Start Date, the name of the column also changes to Start Date.

    4. Configure each element that you add to a table, the same as if you were adding the element to the form without a table. Each one is a basic element, except the Date Time field and the Select field.

      For date fields the value returned must be a long or appropriately formatted string. For label columns the value is converted to a string. For spinner columns, the value must be an integer or double. For text columns, the value is converted to a string.

  4. Repeat the previous step for each element that you want to add to the table.

    The second element that you add specifies the name and data type of the second column, as illustrated in the previous step. For example, you can add a Text element as the second column. In that case, the second column is titled Text and must contain text data. As noted in the previous step, you can optionally rename the element, which automatically renames the column.

  5. To add rows to the table, do the following:
    1. Select the Row field on the Table element on the System folder.
    2. Drag-and-drop it on the Table element on the form.
    3. Repeat these steps until you have added all the rows that you want.

    Note: You cannot move, copy, cut, or paste rows.

  6. Define values for each row in the table, as follows:
    1. In the first row, specify the static values of each cell, using their value attribute.
    2. In the remaining rows, specify values using the column attribute.

      The Form Designer does not validate any actual data or the format of any data that you enter in the rows of the table. However, when users display the form in a request, the Catalog system validates the data and displays it only if you use the correct format. Thus, any invalid values that you specify do not appear when users view the form in a request. For example, if you specify a string value for a date column, the corresponding table cell appears empty to the user. Therefore, be careful to specify the correct format. For example, enter only dates in Date Time fields and only text in Text fields.

    3. Perform this step if applicable; otherwise, skip it.

      If you are using a Select field whose Multi-Select attribute is set to false, then the Select field does not contain the value attribute. In that case, do the following:

      • For the first row: Enter the value of the Selected Index attribute of the Select field. For example, to specify the first option, enter 0. To specify the second option, specify 1, and so on.
      • For the remaining rows: Copy the value of the value attribute from the select option of the Select field. Paste this value into the column attribute of the row.
  7. Specify any or all of the following additional attributes:

You have created a static table.