Controlling the display of subforms based on a conditional statement

This Data Nominated Subforms snippet demonstrates how one of several alternative subforms can be displayed on the form based on a conditional statement. You use data binding to set the condition that determines which of the subforms appears on the form.

The subforms are wrapped in a subform set. In Designer, a subform set can control the display of subforms based on the flow of data. In this example, the Comedy subform is displayed each time the category in the data equals comedy, the Action subform is displayed each time the category equals action, and the Drama subform is displayed each time the category in the data equals drama.

The alternative subforms are specified in the Edit Data Nominated Subforms dialog box. To display this dialog box, select the Movie subform set object and click Edit Alternatives on the Subform Set tab of the Object palette.

To see similar examples, visit the LiveCycle Developer Center.

You must merge the form with data when generating the PDF file. If not, the data will be unavailable for the script that decides which subform to instantiate. Users who open the PDF file in Adobe® Acrobat® will get a warning message. To avoid the warning, you can add script to verify the existence of a data value before executing the script.

// Ethnio survey code removed