Table Of Contents

Selector Controls (G Dataflow)

Last Modified: November 28, 2016

Create a list that a user can cycle through to make selections.

Types of Selector Controls

Control Description Data Type
Ring A ring control is a numeric input that presents a set of choices associated with numeric values.

32-bit signed integer (I32)

Enumerated type, or Enum The enum control is an object that presents a set of choices associated with an enumerated data type. The enumerated data type consists of a set of named constants.

A user-defined enumerated data type

Combo Box The combo box control is an object that presents a list of names associated with string values. Users may select from items in a predefined list or enter new values directly, at edit time or run time.

String

Which Selector Control Should I Use?

Ring, enum, and combo box controls are similar in that they contain lists of strings through which you can cycle.

Unlike the strings listed in rings and enums, the strings listed in a combo box have no numeric representation. Additionally, enums require these numeric values to be sequential, unsigned integer values, while rings allow for much more freedom in assigning a numeric value.

Control When to Use Examples: E-Commerce Application
Ring

Use a ring when you want your user interface to provide a list of choices that represent numeric values. The ring control is a numeric input that allows the user to choose from a list of meaningful, human-readable values instead of numeric values.

If the logic of your program prefers numeric values to string values, you should use a ring.

You want to present the user with a list of product names, each of which corresponds to a unique product number. You can specify the products' numbers as their respective numeric values. You can then cross-reference those numeric values to find the prices of the items.

Enumerated type, or Enum

Use an enum when you want your user interface to provide a list of choices associated with an enumerated data type.

If you want your program to deal with a fixed set of constants instead of arbitrary numeric data, you should use an enum.

You want to present the user with a list of shipping speed options for the item they want to order. The numeric values assigned to each of the options are automatically defined and cannot be edited.

You can use the enumerated data type in the enum control to drive the logic of your program. For example, because the names of the choices are part of the data type, you can use them to populate the cases of a Case Structure. This ensures that only valid states are used in your program.

Combo Box

Use a combo box when you want to provide a list of items for users to cycle through while also providing the option to type new values into the menu at edit time or run time.

If the logic of your program requires string values rather than numeric values, you should use a combo box.

You want to present the user with a list of previous shipping addresses, while also allowing them to enter a new shipping address for this purchase.

How Do I Assign Specific Values to the Selector Controls?

  1. Select the control to which you want to assign specific values.
  2. On the Item tab, in the Items section, assign and arrange specific values as desired.

Enabling a Combo Box to Accept New Values from the User at Edit Time or Run Time

  1. Select the combo box control.
  2. On the Item tab, in the Items section, select Allow Entry of Unlabeled Values.

Type-Ahead Functionality

As a user enters text into a combo box with typing enabled, the combo box suggests the closest match to the user's input.


Recently Viewed Topics