Creating programmable tables

About this task

There are four types of tables you can create in Domino® Designer:

  • Basic tables -- Tables with a designated number of columns and rows.
  • Tabbed tables -- Tables that let users switch rows by clicking on tabs at the beginning of the table.
  • Animated tables -- Tables that switch rows at an interval you designate. Note that animated tables do not work on the Web. Also, animated tables on forms are not designed for field entry.
  • Programmable tables -- Table that switch rows based on an action or field formula.

Because steps for creating a basic, tabbed, or animated table in Designer are the same as for creating tables in the Notes® client, see the topic Creating tables in the Notes® Client Help. You can also press F1 for help when you are creating a table.

How programmable tables work

About this task

Programmable tables let you create a table that displays one row at a time, based on an action or field formula. A programmable table starts as a tabbed table that looks like a Designer Properties box. One tab, or row, of the table is visible at a time to the user. With regular tabbed tables, the user clicks the tabs at the beginning of the table to select which row displays. With programmable tables, the user clicks on an action, a link, or an outline entry to select which row appears.

You write a formula in the Script area of the Programmer's pane to control which row displays and to associate the row with an action, link, or outline entry. Include a field in the formula that has the same name as the name you give to the table in the Table Properties box, except precede the field name by a dollar sign ($). Remember that table field names are case-sensitive: $table is a different table field name than $Table.

For example, on your company's home page, you could put a programmable table that displays different information about your company depending on what your site visitors want to see. If they click the "Location Information" hot text they would see the row of the table that gives them the location of your company. If they click the "Company History" hot text they see the row of the table that describes your company's history.

Note: When you are designing programmable tables on a form, you can use a field on the form to control the table. You can use a choice list field that refreshes on change or use a computed field.

To create a programmable table

Procedure

  1. Move the cursor to where the table will appear on the page or form. In a document, you must be in a rich-text field.
  2. Choose Create - Table. The Create Table dialog box appears.
  3. Select the number of rows and columns for the table.
    Note: All columns in a row will appear when the row is displayed.
  4. Under Table Type, click the programmable table button.
  5. Click OK.
  6. Select the table. Choose Table - Table Properties.

  7. Do the following on the Table Programming tab of the Tables Properties box:
    • In the Table HTML Tags field, enter a Name/ID for the table.
    • Click each row of the table and enter a name for each row in the "Row Tags" field.
  8. Optional: To display tabs so users can switch rows, select "Also show tabs so user can pick row" on the Table Rows tab.
  9. Format the table.
  10. Enter text, graphics, or objects in the table.
  11. Create links, a button, or an outline entry that will set the fields for the table and control what displays.

Example: Creating hotspots to control a programmable table

Procedure

  1. Create a two-row, two-column, programmable table on a page. Name the table CompanyInfo. Name the first row "a" and the second row "b."
  2. Enter text and graphics in each row and column of the table.
  3. Enter a line of text on the page (following the table) that is related to what users will see when that row of the table is displayed. Enter a line for each row of the table. For example, if you have a two-row table -- one row has the company location and the other has the company history -- enter two lines of text:

    Our company locations

    Our company history

  4. Select the text for the first line and choose Create - Hotspot - Action Hotspot.
  5. Select the Hotspot Click event in the Objects tab of the Info List in the Programmer's pane.
  6. Enter a formula in the Script area of the Programmer's pane that sets the field $CompanyInfo to the name of the row of the table you want to display.
    FIELD $CompanyInfo:= "a";
    @Command([RefreshHideFormulas])
  7. Select the second line of text and create a hotspot with the formula:
    FIELD $CompanyInfo:= "b";
    @Command([RefreshHideFormulas])

Results

When users click on the first hotspot they will see the text and graphics in the first row of the table only. When they click on the second hotspot they will see the text and graphics in the second row of the table only.