You can drag a variable from the EGL Data view
to the Design surface of the EGL Rich UI editor. The purpose is to
place widgets that will hold business data. You can also add controllers
and a form manager.
For details on controllers, see Rich UI validation and formatting. For
details on form managers, see Form processing with Rich UI.
To add data to a Rich UI page display:
- Open a Rich UI Handler part in the EGL editor and, if necessary,
click the Design tab. Notice the EGL Data view, which is located by
default in the lower left corner of the workbench.
- In the EGL Data view, ensure that the tree under the handler is
expanded to display all the global variables that are in the handler.
- To create a new global variable in the handler:
- Right-click the background of the EGL Data view, then click .
- In the Create a new EGL Data Variable window,
under Type Selection, click a variable type.
- For Primitive variables, click the Data Type from
a list, and supply a size in the Dimensions fields
if appropriate.
- For a record or primitive variable, select an existing part from
the list. To narrow the list, you can specify initial characters for
the part name in Enter the name of the [Record | DataItem]
part to search.
- For a record or primitive variable, you can select the Array option
under Array Properties. You can specify a Size for
the initial number of elements in the dynamic array, or you can leave
the field blank.
- Specify a name for the new variable in Enter the name
of the field.
- Click Finish.
- Drag a variable from the EGL Data view onto the editor. The purpose
here is to add widgets and related code. You can drag an array of
records, but cannot drag an array of variables that are based on primitive
types or data items.
When you position the cursor over a valid area
to drop the variable, the background of that area turns green. Other
available areas have yellow backgrounds. You can change these default
colors by clicking .
- The Insert Widget wizard opens. Use this wizard to specify the
types of widgets that EGL creates from the fields in the record.
For
non-array variables, the wizard adds widget pairs, as follows: a widget
that displays business data, plus a label for that widget. The wizard
creates a new grid layout and embeds the new widgets into that layout.
The following set of radio buttons further affects the code that is
provided for you:
- Read-only data
- The widgets that display business data are read only. If you want
the wizard to add a controller for each widget pair, select the Add
support for formatting and validation check box.
- Editable data
The widgets that display business data accept user input. If
you want the wizard to add a controller for each widget pair, along
with a form manager and related functions that apply to all the content
in the new grid layout, select the Add support for formatting
and validation check box.
In relation to setting
up error-message handling for controller-level validation, the default
behavior of the wizard is as follows:
- If you are using one of the EGL Dojo widgets that support view-level
validation, the messages that result from controller-level validation
are placed in a tooltip near the widget, when the widget gains focus.
- If you are using another widget, you handle the errors by writing
a function and assigning it to the controller-specific validStateSetter property.
Use the controller-specific function getErrorMessage to access
a message.
If you want to use an error label to display error messages
automatically from a controller-level validation, select Use
error label to support error messages.
- Combination of read-only and editable data
The widgets that display business data are initially read only,
and you can change the settings in the code as necessary. If you want
the wizard to add a controller for each widget pair, along with a
form manager and related functions that apply to all the content in
the new grid layout, select the Add support for formatting
and validation check box. To include an error label, select Use
error label to support error messages.
For record arrays, the wizard creates a new
grid layout and embeds a data grid into that layout. At this time,
the data grid is always read only, and the code provided for you is
solely the data grid regardless of your selection on the first set
of radio buttons.
- Under Fields to display, select each field
you want to display in the interface. For each field, you can change
the information in the following columns:
- Field name
- Select the fields to include in your code. This column is useful
for records and record arrays.
To select all fields, click All.
To select no fields so you can add the fields one by one, click None.
- Label
- Enter the name that you want EGL to display next to the field
in the interface. For arrays of records, the label is used for the
column header.
- Widget Type
- Click the arrow next to the default selection to display a list
of possible widget types for the field. This option is not available
for arrays of records.
- Widget Name
- Enter a variable name to associate with the widget in the source
code.
- You can change the order of fields in the code that will be created
for you. Here is the process:
- Select one row by clicking at the leftmost part of the row. If
a row is already selected, you can select a different one by pressing
the up or down arrows on your keyboard.
- If you also want to select a single adjacent row, click that second
row while holding down the Ctrl key. Alternatively, if you want to
select a range of adjacent rows, click the last row in the range while
holding down the Shift key.
- Click the up or down arrow at the right of the Configure
data widgets page.
- Click Finish.