User Input Components

This section discusses the use of the various built-in components that process user input, i.e., buttons, text entry components, and list selection components.

Buttons:
Button Components

RadioButtons:
Button Components

CheckBoxes:
Button Components

Buttons

Echo provides various button components including simple pushbuttons (Echo.Buttons) and toggle-able buttons which provide a selection state (Echo.RadioButtons and Echo.CheckBoxes).

Visual Appearance: All button components may be configured with colors, fonts, borders, background images, custom labels and custom icons. Mouse rollover and button-press effects may be set to alter the appearance of a button when the mouse is within its bounds and when it is being clicked, respectively. Using these various stylistic properties, buttons can be configured to look like HTML links or like traditional buttons found in a GUI application.

Types of Buttons

Pushbuttons: The Echo.Button component is a simple "push" button that provides the user with the capability to invoke an action. Pushbuttons have no selection state.

Checkboxes: A Echo.CheckBox is a button which has an on/off selection state. If you click a checkbox, the selection state will be toggled.

RadioButtons: The Echo.RadioButton component enables the user to select one option from a group of options. A Echo.RadioButton can be assigned to a group, which will allow only one radio button to be selected at a time. To do this, set the group property of a radio button to a unique identifier naming the button group. It is recommended that you use Echo.generateUid() to generate a unique identifier.

Events

action: When it is clicked, a button will fire an event to all registered listeners of type action. If the actionCommand property of the button was set, this information will be included as the actionCommand property of the received event. The use of action commands can be beneficial in circumstances where one action listener is registered with more than one button.

Text Components

A TextField:
TextField Component

A PasswordField:
PasswordField Component

A TextArea:
TextArea Component

Text components provide the capability for the user to enter text data into an application. Echo provides three standard text components, all derived from the Echo.TextComponent base class:

Echo.TextField: The Echo.TextField component provides the capability to enter a single line of text.

Echo.PasswordField: A derivative of Echo.TextField, Echo.PasswordField adds a mask to user-input to facilitate on-screen password entry.

Echo.TextArea: The Echo.TextArea component provides the capability to enter multiple lines of text.

Events

action: Events of type action are fired by a Echo.TextComponent when the enter key is pressed within the component.

List Components

The list components, i.e., Echo.SelectField and Echo.ListBox, provide the capability to select one or more items from a list of items. List components are derived from the Echo.AbstractListComponent base class.

An Echo.SelectField:
SelectField Component
An Echo.ListBox:
ListBox Component

Events

action: A list component will fire an event of type action when an item is selected.