AX1527

Using buttons as selectors (button groups)

You can use multiple Button components as selectors in a form. To do this, you assign two or more buttons to a designated button group. You can configure the form to change based on which button is the currently selected button in the group. When using this approach, the Button components behave like Radio Button components.

Using buttons vs radio buttons

There are a couple of reasons why you might want to use regular buttons instead of radio buttons as selectors:

  • Button components can display as images or as hyperlinks in the form. If you want users to select by clicking images or links instead of radio buttons, then you must use Button components.

  • Button components can execute commands when they are clicked. If you want to execute a command when a particular button is clicked, then you must use Button component.

One disadvantage of using Button components instead of Radio Button components is that Button components do not have a built-in visual representation to indicate which Button component is the currently selected button. There is no "pressed" style for Button components. However, if you use the Image button style, you can assign a different image to display when the button is selected.

Configuring Button components as selectors

In order to use Button components as selectors, you must configure the buttons as follows:

  • The Button Behavior property must be set to Command. You do not need to use a command, but this is the only behavior setting that supports button groups.

  • The Button Group property must be set to the name of the button group. You can type in a name to create a new button group for the form, or you can select from button groups that have already been created. Only one button in a button group can be the currently selected button.

  • If you want one of the buttons in the button group to be selected by default, then enable the Is Selected check box for that button. When a user opens the form, this button will be selected to start. If the user then clicks a different button in the button group, that button will be marked as selected and the original button will be cleared.

As previously noted, it is recommended to use the Image button style when using Button components as selectors. You can have two versions of each button image—an "unselected" image and a "selected" image. For example, the unselected image could show an icon, and the selected image could show a color-reversed version of the same icon. These images should be specified as the Image Path and the Image Path (selected) respectively. When a user clicks on a button to select that button, the button will update to display the "selected" image. (Alternatively, symbols can be used instead of image files.)

Using button groups

Button groups track the "currently selected" state among two or more buttons. When a user clicks a button that belongs to a button group, the Is Selected setting is enabled for the button that was clicked, and disabled for all other buttons in the group. This allows you to configure interactivity for the form based on the currently selected button in the group, such as hiding or showing certain content in the form.

What occurs when a user selects a radio button is entirely up to the form designer. For example, a form could have three image buttons that show images representing the three main product lines of your organization. These three buttons could belong to a button group named Product. The form could also contain other components such as grids and charts that show data related to the currently selected product line. These other components would be set up using formulas to change the data displayed based on the currently selected button in the Product button group.

If a Button component belongs to a button group, the button still triggers a form update and performs any commands it is configured to perform. The only difference is that the Is Selected field will also be updated for the button and all other buttons in the group, which may in turn impact other components or data queries in the form that have been configured to reference this setting.