WebSpeed
Developer’s Guide


Formatting DISPLAY Output

In general, DISPLAY output is formatted using SpeedScript frames. These are not HTML frames, but are logical structures maintained by SpeedScript to manage its output. There are several types of SpeedScript frames you can use to stream output to the Web, and this output can be organized into still larger, multi-frame stream pages. Stream pages are not Web pages, but logical sections of a Web page containing one or more SpeedScript frames. For information on the available types of SpeedScript frames, see the Frame Phrase entry in the Progress Language Reference.

Keep in mind that these SpeedScript frames and the larger multi-frame stream pages are structures that WebSpeed uses to format a single Web page for a single request. They do not, in and of themselves, return as successive individual Web pages, such as appears for large result sets from a Web search engine. They merely provide a means to partition and give structure to a single Web page using DISPLAY and other SpeedScript statements.

NOTE: Stream paging applies both to DISPLAY and PUT ({&OUT}) statement output. However, only DISPLAY (and SQL SELECT) statements output SpeedScript frames.

You can format DISPLAY statement output using two mechanisms:

Paging Options of the OUTPUT TO "WEB" Statement

The two paging options include:

To open an unnamed output stream with 25-line stream pages, you specify this:

OUTPUT TO "WEB" PAGE-SIZE 25. 

Each stream page contains the following output ordered and organized into one to three sections, all within the number of lines specified for the stream page:

  1. Any content from activated SpeedScript PAGE-TOP frames for the current OUTPUT stream. Otherwise, the stream page begins with the second section.
  2. Any other DISPLAY or PUT statement output for the current OUTPUT stream. If DISPLAY output is for a SpeedScript DOWN frame, any column headers are printed in the following occurrences:
    • At the start of an iteration block.
    • At the start of the stream page or immediately after any output from PAGE-TOP frames.
    • If DISPLAY output is for a SpeedScript frame other than a DOWN frame, the entire content from the specified frame is output for each DISPLAY statement.

      All output in the second part of the stream page continues until the line number required to start any activated PAGE-BOTTOM frame or after the last line of the stream page, which ever comes first. If PAGE-BOTTOM frame output is activated, the stream page continues with the third section. Otherwise, the stream page is complete.

  3. Any content from activated SpeedScript PAGE-BOTTOM frames for the current OUTPUT stream until the stream page is complete.
NOTE: Activate SpeedScript PAGE-TOP and PAGE-BOTTOM frames using DISPLAY statements. These statements do not immediately output the frames, but make them ready for output at the appropriate point in a stream page. Note also that PUT statements (most often coded using the WebSpeed {&OUT} preprocessor reference) can send output in the second section of a stream page. But this output is not part of any SpeedScript frames, which are used only by DISPLAY statements.

WebSpeed also provides a means to automatically separate successive stream pages in the HTML using a specified divider. The HTML for this divider is specified by the HTML-END-OF-PAGE attribute of the WEB-CONTEXT system handle. For more information, see the "HTML Attributes of the WEB-CONTEXT Handle" section.

For more information on setting these options, see the "Changing Output Format Defaults" section in this chapter.

HTML Attributes of the WEB-CONTEXT Handle

The WEB-CONTEXT handle provides a set of attributes to modify the formatted output in a Web page. Each attribute is a character string that contains HTML you want to add to a specified portion of SpeedScript frame and paged output. Any settings that you make to these attributes last only until the next Web request. Each request causes the Agent to reset these attributes to the default values. This is true for both stateless and state-persistent Web objects.

Table 6–1 describes how to use these attributes.

Table 6–1: WEB-CONTEXT Handle HTML Attributes
Attribute
(Location in Output)

Description
HTML-END-OF-LINE
(End of Line)
Defaults to the newline character (ASCII 10; ’~n’; ’\n’). A null string value causes a NEWLINE character (not a null string) to be output. You might set this to <BR>. However, depending on the other attribute values, using the NEWLINE rather than the <BR> tag can result in more readable output when viewing document source in a browser.
Output at the end of each data row for the current iteration of a DOWN frame.
HTML-FRAME-BEGIN
(Before a SpeedScript frame)
Defaults to "<PRE>". Generally, if you change this value you must change the value of HTML-FRAME-END.
Output only before the data rows for the current iteration of a DOWN frame, not to column headers (see also HTML-HEADER-BEGIN and HTML-HEADER-END). Applies to any side-labels displayed in the frame, whether or not the frame is a DOWN frame.
HTML-FRAME-END
(After a SpeedScript frame)
Defaults to "</PRE>". Generally, if you change this value you must change the value of HTML-FRAME-BEGIN.
Output at the end of the data rows for the current iteration of a DOWN frame.
HTML-HEADER-BEGIN
(Before the column headers of a SpeedScript frame)
Defaults to "<PRE>". Generally, if you change this value you must change the value of HTML-HEADER-END.

Output at the beginning of the column header section of a DOWN frame.
HTML-HEADER-END
(After the column headers of a SpeedScript frame)
Defaults to "</PRE>". Generally, if you change this value you must change the value of HTML-HEADER-BEGIN.

Output at the end of the column header section of a DOWN frame.
HTML-TITLE-BEGIN
(Before a SpeedScript frame title)
Defaults to the null string (""), no text. Generally, if you change this value you must change the value of HTML-TITLE-END.

Output before the frame’s TITLE value. Setting to a color or bold tag might improve readability.
HTML-TITLE-END
(After a SpeedScript frame title)
Defaults to the null string (""), no text. Generally, if you change this value you must change the value of HTML-TITLE-BEGIN.

Output after the frame’s TITLE value.
HTML-END-OF-PAGE
(Between stream pages)
Defaults to "<HR>".

Output between stream pages to visually break up the sectioning caused by the PAGED or PAGE-SIZE options of the OUTPUT TO "WEB" statement. Does not affect the line count of any stream page.

For information on how to set and read these attributes, see the WEB-CONTEXT Handle entry in the Progress Language Reference. For information on setting new defaults for these attributes, see the "Setting HTML Attribute Defaults" section.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095