Insert a choice group InfoPath 2007
Author: mety Labels:: Insert a choice group InfoPath 2007A choice group is a control that is used to present a set of mutually exclusive choices to users. By default, a choice group contains two choice sections, one of which appears to the user as the default choice on the form. Use a choice group when you want to:
The choice sections inside the choice group contain the controls that users interact with when they fill out the form. Choice sections are always contained within choice groups. Thus, if you try to add a choice section by itself to your form template, Microsoft Office InfoPath automatically creates a choice group in which to contain it. Related controlsInfoPath includes other controls that are similar to choice groups but that serve different purposes. To decide which of these controls works best on your form template, refer to the following list:Section Sections are similar to the choice sections in a choice group, in that you use them to present users with a related set of controls. However, sections are used purely for organizational purposes — users cannot remove or replace them when filling out a form, as they can with choice sections. Optional section When you add a choice group to your form template, the default section always appears when a user first opens a form that is based on your form template. Optional sections, on the other hand, are hidden by default. Users can choose whether to include an optional section on the form. For example, on the purchase request form mentioned earlier, some users may want to include comments about the computer that they plan to order. You can insert an optional section on the form template and add a rich text box labeled "Notes" inside that optional section. Users can then add the notes section when and if they want it by clicking instructional text on the form. Repeating section Like repeating choice groups, repeating sections allow users to add more than one section to their form, depending on their needs. Use a repeating section on your form template when your goal is to allow your users to insert, but not replace, multiple instances of a section. Repeating choice group Repeating choice groups are just like choice groups, except that users can insert more than one of them on their form. For example, on the purchase request form mentioned earlier, users can choose to request a desktop computer or a laptop computer. However, in some cases, a user might want to request both types of computers or multiple computers of each type. If a repeating choice group is used on the form, the user can choose to fill out the section that contains desktop request information. Then the user can insert a second instance of the choice group in order to fill out the section that contains laptop request information. The user experienceIn both appearance and behavior, choice groups resemble sections and other layout-related controls. The key differences are that users can replace the default section inside a choice group with an alternative section or delete the choice group entirely.When users move their cursor over the default choice section, a small purple button appears in the upper-left corner of the section. When users click this button, a shortcut menu shows commands for removing or replacing the default section. Tip With a choice group, users can remove or replace the default section, but they can't insert multiple instances of it on the form. If you want users to be able to insert additional sections on their form, you should use a repeating choice group instead of a choice group. From the user's perspective, the experiences are similar. However, in addition to seeing shortcut menu commands for removing or replacing the default section, the user also sees commands for inserting multiple instances of the choice group. Compatibility considerationsWhen you design a form template in InfoPath, you can choose to design a browser-compatible form template (browser-compatible form template: A form template that is designed in InfoPath by using a specific compatibility mode. A browser-compatible form template can be browser-enabled when it is published to a server running InfoPath Forms Services.). When you design a browser-compatible form template, choice groups and choice sections are unavailable in the Controls task pane because they cannot be displayed in a Web browser.Insert a choice groupThe procedure for inserting a choice group on a form template differs slightly depending on whether you are designing a new, blank form template or basing the design of your form template on a database or other external data source.The following illustration shows how a choice group looks when it is selected in design mode (design mode: The InfoPath design environment in which you can create or modify a form template.). Controls can be bound or unbound. When a control is bound, it is connected to a field or group in the data source so that data entered into the control is saved in the underlying form (.xml) file. When a control is unbound, it is not connected to a field or group, and data entered into the control is not saved. When you select or move your pointer over a control, text and a binding icon appear in the upper-right corner of the control. The text indicates the group or field to which the control is bound in the data source. The icon indicates whether the control is correctly bound to that group or field. When the binding is correct, a green icon appears. If there's something wrong with the binding, you'll see a blue or red icon instead. The data source for the form template consists of fields and groups that appear in a hierarchical view in the Data Source task pane. Choice sections are always bound to groups. Each control in a choice section is bound to a field (field: An element or attribute in the data source that can contain data. If the field is an element, it can contain attribute fields. Fields store the data that is entered into controls.) that is part of the choice section's group. In the following example, the Desktop computer choice section on the form template is bound to the desktop group in the Data Source task pane. Insert a choice group on a new, blank form templateWhen you design a new, blank form template, the Automatically create data source check box in the Controls task pane is selected by default. This enables InfoPath to automatically create fields and groups in the data source as you add controls to the form template. These fields and groups are represented by folder and file icons in the Data Source task pane.As you insert a choice group, InfoPath creates groups that are bound to the choice sections inside that choice group. In addition, InfoPath creates a special kind of group to visually indicate the relationship between the choice group on the form template and the data source. This type of group includes the word (choice) next to its label in the data source.
Insert a choice group on a form template that is based on an existing data sourceIf you base the design of your form template on an existing Extensible Markup Language (XML) file, database, or Web service, InfoPath derives the fields and groups in the Data Source task pane from that existing data source. For example, suppose that you base the design of your form template on an XML Schema, and that schema includes an xsd: choice element. In this circumstance, you can insert a choice group by dragging the appropriate group from the Data Source task pane onto your form template. If you instead use the Controls task pane to insert a choice group, InfoPath prompts you to bind the choice group to an existing group in the data source, as described in the following procedure:
Layout tipsUse the following tips to help you refine the appearance, size, and other aspects of the choice groups and choice sections:
|