Insert a list box InfoPath 2007
Author: mety Labels:: Insert a list box InfoPath 2007You can use a list box in a Microsoft Office InfoPath form template to present a list of mutually exclusive choices to a user. Use a list box when you want to:
In the following illustration, users categorize expenses in an expense report form by selecting values in a list box. After you insert a list box on your form template, you must specify the values that you want to appear in it. Otherwise, users will see an empty list when they open a form that is based on your form template. In the List Box Properties dialog box, you can type the entries yourself or configure the list box to retrieve entries from a database or other data source. Related controlsInfoPath includes controls that are similar to list boxes but that serve different purposes. To decide which of these controls works best on your form template, refer to the following list: Drop-down list box Like a list box, a drop-down list box offers users a list of choices. However, in a drop-down list box, the list entries are hidden until the user clicks an arrow next to the list box. If you plan to offer many choices in your list, or if space on your form template is limited, a drop-down list box can be a good choice. Combo box Like a list box, a combo box offers users a list of choices. However, in a combo box, the list entries are hidden until the user clicks an arrow next to the combo box. Users can type their own entry into a combo box or choose from a list of predefined entries. Multiple-selection list box If you want users to be able to choose more than one item in a list, you can use a multiple-selection list box instead of a list box. In a multiple-selection list box, users indicate a choice by selecting one or more check boxes instead of clicking a value in a list. As with standard list boxes, the entries in a multiple-selection list box are visible when users first open the form. Option buttons Like a list box, a group of option buttons enables users to select from a list of mutually exclusive choices. However, with option buttons, users click a small circle to make a choice instead of clicking an item in a list box. The user experienceList boxes are one of the most commonly used form controls, so most users know how to use them. To select something from a list box, users simply click the item that they want. The list box is "open," so users can see the list of choices without having to click the control. If the choices in the list exceed the height of the box that contains them, a scroll bar appears on the right side of the control. If users are using the keyboard to fill out the form, they can press the UP ARROW and DOWN ARROW keys to move through the items in the list box. Insert a list boxThe procedure for inserting a list box 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 list box looks when it is selected in design mode, before a label and entries are added. 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. List boxes are always bound to fields (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.). In the following example, the Category list box on the form template is bound to the category field in the Data Source task pane. When 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. If 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. Insert a list box
Layout tipsUse the following tips to help you refine the appearance, size, and other aspects of a list box:
|