Release 10.1A: OpenEdge Development:
Progress 4GL Reference

> ## VIEW statement

> Displays a widget (sets its VISIBLE attribute to TRUE).

> Note: Does not apply to SpeedScript programming.

> #### Syntax

>     VIEW
>       [ STREAM stream ]
>       [ widget-phrase ]
>       [ IN WINDOW window ]

> `STREAM `stream``

> Specifies the name of a stream. If you do not name a stream, Progress uses the unnamed stream.

> ``widget-phrase``

> Specifies the widget you want to view. You can view windows, frames, and field-level widgets. You cannot view menus. If you do not use this option, VIEW sets the VISIBLE attribute for the default frame for the current block.

> `IN WINDOW `window``

> Specifies the window in which to view the widget.

> Example

> The `r-view2.p` procedure displays information on a sales representative and then displays all the customers belonging to that sales representative. Each new sales representative is displayed on a new page. In addition, if the information for a sales representative takes up more than one page, a separate FORM statement describes a continuation header for that sales representative. The VIEW statement for the PAGE-TOP frame hdr2, activates the header for subsequent page breaks.

> r-view2.p
>     OUTPUT TO slsrep PAGED PAGE-SIZE 10.

>     FOR EACH salesrep:
>       PAGE.
>       FORM HEADER "Sales rep report" "Page" AT 60 PAGE-NUMBER FORMAT ">>>9".

>       DISPLAY SKIP(1) sales-rep rep-name region WITH NO-LABELS.

>       FORM HEADER "Sales rep report" sales-rep "(continued)"
>         "Page" AT 60 PAGE-NUMBER FORMAT ">>>9" SKIP(1)
>         WITH FRAME hdr2 PAGE-TOP.

>       VIEW FRAME hdr2.

>       FOR EACH customer OF salesrep:
>         DISPLAY cust-num name address city state.
>       END.
>     END.

> #### Notes

> - If the widget is already visible, the VIEW statement has no effect.

> - Viewing a widget does not, by itself, show any of its data. To view data in a widget, you must use a data display statement (such as DISPLAY) or assign the data directly to the widget’s SCREEN-VALUE attribute.

> - When you view a window, its frames and their descendant widgets are not displayed, unless you explicitly view or display them.

> - When you view a widget, Progress displays that widget unless its parent window or an ancestor window has its HIDDEN attribute set to TRUE.

> - When you view a widget that has its HIDDEN attribute set to TRUE, Progress sets the widget’s HIDDEN attribute to FALSE.

> - When you view a widget contained by a window that is invisible (VISIBLE attribute is FALSE), that widget and the containing window is displayed unless the containing window’s HIDDEN attribute is set to TRUE.

> - When you view a widget contained by one or more ancestor frames that are invisible, the VISIBLE attribute is set to TRUE and the HIDDEN attribute is set to FALSE for both the viewed widget and all its ancestor frames. However, if the containing window or an ancestor window has its HIDDEN attribute set to TRUE, neither the viewed widget nor its ancestor frames are displayed.

> - When you view a frame, that frame and all widgets contained within it are displayed except those widgets whose HIDDEN attributes are set to TRUE.

> - When you view a window, Progress displays that window and any ancestor windows only if no ancestor window has its HIDDEN attribute set to TRUE. If Progress displays the window, it also views any descendant windows down to, but not including, the first descendent window that has its HIDDEN attribute set to TRUE.

> - If you are displaying a root frame and there is not enough room in the window for the new root frame to display, Progress removes other root frames, starting from the bottom of the window, until there is room for the new root frame.

> - In the case of a PAGE-TOP or PAGE-BOTTOM frame, the VIEW statement activates the frame for display at the beginning or end of each page.

> #### See also

> HIDE statement, Widget phrase

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