Widgets

In Uniface, widgets are user interface controls. They can display data values, control how values are modified, and determine the appearance of those objects. Most widgets are field-level widgets.

Explicit and Implicit Widgets

For fields and entities, you can explicitly choose the widget you want to use to represent the data. For example, you can choose whether a field should be an edit box or a check box, a list or radio buttons, a picture or a button. In forms, you can choose whether to use the default entity widget or the grid widget.

For components and entity occurrences, the associated widget is implicit. You do not have a choice of another widget. For example, the layout of a component is really a property of its implicit widget.

In desktop applications, windows are the implicit widget of components and applications shells. You can set window properties to control the window appearance and behavior.

Occurrence widgets are built into the parent entity.

Note: Because component and occurrence widgets are implicit, the term widgets usually refers to field-level widgets, and sometimes to entity-level widgets.

Widget Properties

Each widget has an associated set of properties that affect how the data is presented in the user interface. These properties can be set in the usys.ini file, in object definitions, and in script.

The effect of widget properties depends on the user interface technology, the parent object, and the property itself. For example, if no background color is defined for a field-level widget, it may inherit the color from a parent occurrence, entity, or component.

For more information, see Properties for Styling the User Interface.

Widget Appearance

The appearance of a widget at runtime is determined by the following:

  • Type of component. Each type of component has its own set of supported widgets, and each widget has its own set of properties.

    For example, the Form, Dynamic Server Page, and Static Server Page each have widget for an edit box used to enter data, but the widgets are not the same and they have different properties and triggers.

  • Runtime environment, including platform (web, desktop, or mobile), operating system, browser (for web and mobile apps), and user interface (Windows or character-based).

    For example, Dynamic Server Page components can run on many platforms, including Windows, Android and iOS, and in different browsers. Both the OS and the browser used can affect how a DSP widget is rendered.

  • Widget property values in effect at runtime. These are determined by dynamic changes made in script, declarative values set in the component definition, and default values set in initialization files.

Physical and Logical Widgets

Uniface widgets are usually referred to by their logical widget name. A logical widget is named configuration of a physical widget. It sets the preferred values for some of the widget's properties.

Logical widgets for fields and entities in forms and dynamic server pages map to a physical widget and may set some of its properties. A single (physical) widget may therefore have multiple logical widgets mapped to it.

Uniface provides default sets of logical widgets for forms and dynamic server pages. These are the widgets that are visible in the Widget Type property of entities and fields, and they are used by the default templates provided with the Uniface IDE. For more information, see Logical Widgets.

Related Topics