BUTTONEDIT item type

Defines a line-edit with a push-button that can trigger an action.

BUTTONEDIT item basics

The BUTTONEDIT form item defines an edit field that gets user input, with an additional push button that can fire an action.

This type of form field is typically used to open a secondary window, to let the user choose from a large list of items and set the field value.

Defining a BUTTONEDIT

The IMAGE attribute of a BUTTONEDIT form item defines the picture to be displayed on the button.

By default, the text editor of a BUTTONEDIT allows the user to change the field value. Use the NOTEDITABLE attribute to deny text modification. The field still gets the focus, and the action button remains active, if there is a corresponding action handler in the current dialog.
BUTTONEDIT ...
   IMAGE = "zoom",
   NOTEDITABLE;

The button of BUTTONEDIT form items can inherit action default attributes, to avoid having to specify the IMAGE attributes in all elements bound to the same action. For more details, see Configuring actions.

Most of the attributes described in the EDIT item type can also be used with the BUTTONEDIT.

Front-ends support different presentation and behavior options, which can be controlled by a STYLE attribute. For more details, see Common style attributes and ButtonEdit style attributes.

Detecting BUTTONEDIT button action

The button of a BUTTONEDIT form element acts as an action view for a dialog action, and is bound to the ON ACTION handler by the ACTION attribute. The ACTION attribute defines the name of the action to be sent to the program when the user clicks on the button:
-- Form file
BUTTONEDIT ...
   ACTION = open_city_list;

-- Program file:
ON ACTION open_city_list
   -- Open the city pick-list

The button action can also be a common action name, prefixed with a sub-dialog identifier and/or field name, to define a qualified action view to be used in conjunction with ON ACTION action-name INFIELD field-name.

For more details, see Binding action views to action handlers, Field-specific actions (INFIELD clause).

Where to use a BUTTONEDIT

A BUTTONEDIT form item can be defined in two different ways:
  1. With an item tag and a BUTTONEDIT item definition in a grid-layout container (GRID, SCROLLGRID and TABLE).
  2. As a BUTTONEDIT stack item in a STACK container.

Defining the widget size

In a grid-based layout, the size of a BUTTONEDIT widget is computed by the layout rules as described in Widget size within hbox tags.

In a stack-based layout, the widget will take the full width available in the parent container.

Field input length

In grid-based layout, the input length in a BUTTONEDIT fields is defined by the item tag and may need to get the SCROLL attribute. For more details, see Input length of form fields.