Creating an EGL data item and associating it with a Faces JSP
To create an EGL data item and associate it with a Faces JSP, do as follows:
- Open a Faces JSP file in the Page Designer. If you do not have a JSP file open, double-click on the JSP file in the Project Explorer. The JSP opens in the Page Designer. Click the Design tab to access the Design view.
Note: You can access the related page handler by right clicking in the Design view (or Source view) and clicking Edit Page Code. .
- From the Window menu, select Show View > Other >Basic > Palette.
- In the Palette view, click the EGL drawer to display the EGL data object types.
- Drag New Field from the palette to the JSP. The Create a New EGL Data Field dialog is displayed.
- Type a field name in the Name field.
- Select the field type from the Type drop-down list and, if you need to specify the field's primitive characteristics (length and possibly decimals), type the information in the Dimensions text box. Default masks are used if you declare items of the following types:
- Date (mask yyyymmdd)
- Time (mask hhmmss)
- Timestamp (mask yyyymmddhhmmss)
If you wish to specify a data-item part as the type, select dataItem, which is the last value in the list. In this case, the Select a DataItem part dialog is displayed, and you either select a data-item part from the list or type the name, then click OK.
- If you are not declaring an array of data items, accept the radio button for none.
- If you are creating is an array of data items, select the radio box that indicates the type of array, whether static or dynamic, and type an integer in the Size text box. If you selected static, you are specifying the number of items in the array. If you selected dynamic, you are specifying the maximum number of items that can be in the array.
- If you wish to include the fields in the JSP file, select the check box for Add controls to display the EGL element on the Web page and click OK.
- If you wish only to declare the item or array in the page handler without including the related fields in the JSP file, clear the check box for Add controls to display the EGL element on the Web page and click OK. You can add the field in the JSP file later by dragging the field from the Page Data view to the JSP.
- When the Insert Control dialog is displayed, select the radio button that indicates your intended use of the field:
- For output (Displaying an existing record)
- For input or output (Updating an existing record)
- For input (Creating a new record)
Your choice affects the types of controls that are available.
- To change the field label, select the label that is displayed next to the field name, then type the new content.
- To select a control type different from the one identified, select from a list of types.
- If you click Options, the Options dialog is displayed, and the specific options that are available depend on whether you are using the field for input, for output, or for both. One option in any case is to include or exclude the JSF tag <h:outputLabel> around field labels.
When you complete your work in the Options dialog, click OK.
- The new data item is visible in the Page Data view; and if you included the field on the JSP, the field is also on the Web page.
- Click Finish.
Related reference
Page Designer support for EGL
Primitive types