Developing pages
With 4GL functionality enabled, you can rely on an event-driven
infrastructure to handle many of the details of coding server scripts
for your Web pages. As with other Web target files, you edit 4GL
Web pages in the HTML editor and write scripts in one of the script
editors. The integrated Script editor provides additional support
for some of the features available in 4GL pages.
You can create new 4GL pages or you can modify existing pages
to enable 4GL processing after you add the pages to your Web target.
If you change a non-4GL page to 4GL mode, you must manually
remove any existing FORM tags in Source view. Each 4GL Web page
is represented as a single form. You cannot use nested FORM tags
on these pages.
Creating a new 4GL Web page
You create new 4GL Web pages using the 4GL Web/JSP
Page wizard. If you want to change an existing page to 4GL mode,
you can enable 4GL mode by selecting a check box in the Page Properties
dialog box for the page.
The 4GL
Web/JSP Page wizard prompts you for basic design information, options
for error reporting, page parameters, and EAServer components
that you want to use on the page. If you are unsure about values
to enter for a particular wizard field, you can leave the field
blank or accept the field default, then add or change the information
later in the Page Properties dialog box.
Specify this | To do this |
---|---|
Style sheet | Select an existing style sheet for the page. |
Background image | Select an image that displays as the page background. |
Scroll image | Make the background image scroll with the page. |
Background color | Select a color for the page background. |
Header based on title | Add a page header that is the same as the title. This header appears on the printed version of the page. |
Date created footer | Add a page footer that shows the date the page was created. This footer appears on the printed version of the page. |
The 4GL
Web/JSP Page wizard also includes a page with selections
for the specialized error reporting capabilities available to 4GL
pages:
Select this | To do this |
---|---|
Show runtime errors in alert message box |
Display page processing errors in an alert message box |
Show runtime errors as text at the top of the page |
Display page processing errors at the top of a generated page |
Show runtime errors as text at the bottom of the page |
Display page processing errors at the bottom of a generated page |
Enable trace | Display detailed information about page processing during page development |
To create a new 4GL Web page:
-
From a Web target select File>New
from the menu bar.or
Right-click a target or target folder in Workspace view
and select New from the pop-up menu. -
Click the Web tab in the New dialog box.
Make sure the Web target to which you want to add a
4GL Web page is selected in the Target drop-down list box. -
Click the 4GL Web/JSP Page wizard icon
to start the wizard, then click Next. -
On the Specify New HTML File page of the 4GL Web/JSP
Page wizard, enter the title and file name for the page you want
to create.If you selected a PowerDynamo or ASP target, the file name
extension is HTM. If you selected a JSP target, the file name extension
is JSP. -
Provide design information for your Web page in
subsequent wizard pages. -
Specify options for error reporting and click
Next. -
Specify any page parameters that will provide
input values for the page and click Next.You can add page parameters at a later time from the Page
Properties dialog box for your page. -
Select an EAServer profile, making sure the
EAServer you select is running. Click Next to list the available
components on this server.
or
Select
the Skip EAServer Components check box if you want to select components
at a later time. Click Next and skip the next step in this procedure.This wizard page lists EAServer profiles already configured
in your development environment.Make sure your EAServer is running If you click Next without selecting the Skip EAServer Components
check box, the wizard attempts to connect to the server that is
selected in the Choose EAServer Profile dialog box. -
Select the EAServer components you want your 4GL
Web page to access, and click Next. -
On the last wizard page, review the summary of
page properties, and click Finish.
Enabling 4GL mode in an existing page
You
change an existing page in your Web target to 4GL mode by opening
the page in the HTML editor and selecting a check box in the Page
Properties dialog box. Some of the pages of the Page Properties
dialog box are available only to Web pages for which you select
the 4GL mode. After you select the 4GL mode check box, you can add
other 4GL properties to the page and access the server-side event
model in the integrated Script editor.
On this page | Specify this |
---|---|
Page | Presentation details for the page. |
Destination | A self-link, or a link to a target page, including parameters and parameter bindings for the target page. Available to 4GL pages only. |
Parameters | Page parameters for the current page and default values for those parameters, if any. You cannot enter default values for parameters on a non-4GL page. |
Variables | Variables that your page will use. Available to 4GL pages only. |
EAServer | Variables that represent EAServer components. Available to 4GL pages only. |
Errors | Type of error reporting the page uses. Available to 4GL pages only. |
JSP Directives | Add directives (page, include, or taglib) to your page. Available in JSP targets only. |
Inline Styles | Style properties for the page. |
Advanced | Additional attributes for the page (some user interface properties, such as a target page link, are also listed here). |
Post-conversion manipulation If you change an existing page to 4GL mode, you must manually
remove any existing FORM tags and you must make sure that each control
on the page has a unique name. If you want to take advantage of
4GL functionality with a control you added before changing the page
to 4GL mode, you must select the Server Side Scriptable check box
on the control property sheet (or add the PSSERVERSCRIPTABLE attribute
for the corresponding INPUT or OBJECT tag in Source view).
To enable 4GL mode in an existing page:
- Open the page in the HTML editor.
-
Right-click in the page, then select Page Properties
from the pop-up menu. -
On the Page tab of the Page Properties dialog
box, select the Enable 4GL Web Server Side Event Model check box.When you select the check box, the 4GL property pages of the
Page Properties dialog box are enabled. -
(Optional) Specify properties for the 4GL Web
page on the newly enabled pages of the Page Properties dialog box.
Adding content to 4GL Web pages
After
you open a new Web page in the HTML editor, you are ready to start developing
the page contents. The Page tab page of System Tree displays information
about any objects and controls that you add to your page.
When you develop a page, you typically add content in a prescribed
order. For example, you define parameters and variables as a first
step, in order to access those values from objects or scripts as
you build the page. The following procedure shows the steps you
will most likely follow to develop 4GL Web pages.
To develop a 4GL Web page:
-
Add page parameters, page variables, and
session variables. - Add access to properties of EAServer components.
-
Insert form controls, and then bind these controls
to parameters, variables, or EAServer component properties already
accessible on your page.See “Adding controls”.
- Set up page navigation.
- Write scripts for the events on your page.