Creating data bindings and conditional statements for choice table sections

After you create a choice section, you can create data bindings with or without conditional statements for the various rows within the section. Using conditional statements provides greater control over when rows within the choice section are displayed on your form than specifying only a data binding.

For each row listed in the Alternative Subforms list in the Edit Data Nominate Subforms dialog box, you can specify a data node from the data connection. If you specify a conditional statement, you can enter an expression that will evaluate to either true or false at run time. Only the first entry in the Alternative Subforms list with a conditional statement that evaluates to true will appear on your form.

To create data bindings and conditional statements for choice table sections

  1. Select a subform set object.

  2. In the Object palette, click the Section tab and ensure that Select One Subform from Alternatives is selected from the Type list.

  3. Click Edit Alternatives.

  4. Choose how you want to specify a row data binding from within the choice section by performing one of the following actions:

    • Click Choose Subform Whose Name Matches Data Element or Attribute to bind data nodes to rows by name. In this case, the names of the associated data nodes must match the names of the rows on your form design.

    • Click Choose Subform Using Expression to bind rows from your form design to data nodes from the data connection by manually specifying a binding.

  5. In the Data Connection list, select the data source you want to bind data from.

  6. Click Add  to insert a new row into your table, or select an existing list item. Adding a new row adds a duplicate of the currently selected row. If no row is selected, a new unnamed row is added to the choice section.

  7. Insert a new subform into the choice subform set, or select an existing list item. Adding a new subform adds a duplicate of the currently selected subform. If no subform is selected, a new unnamed subform is added to the choice subform set.

  8. In the Name field, enter a name for a new row object, if necessary. If you are binding the row by data element or attribute name, ensure that the name in the field matches exactly with the name of the associated data node.

    If you selected the Choose Subform Whose Name Matches Data Element or Attribute in step 4, you can go directly to step 12. Otherwise, continue with step 9.

  9. Click the arrow to the right of the Binding field and select a data node from the pop-up menu. Designer automatically populates the Binding field with a scripting reference to the data node you select. Alternatively, you can manually type a reference into the field.

  10. Select a scripting language from the Language list.

  11. In the Expression field, enter your scripting to perform the actions or processing you want for the specified row and data node.

  12. Repeat steps 6 to 10 for any additional rows within the choice section, and then click OK.

// Ethnio survey code removed