This kind of application window is used to display all sorts of hypertext documents, including plain text and various pieces of information about certain aspects of documents and/or their elements. A viewer window is commonly invoked in cases when some sort of hypertext is recognized, for example in deciding which application to use for handling a response that has been received as a result of making a request.
There are different types of viewer windows, but the overall functionality that is provided by each of them is always the same. In the following, a list of all possible types is given as they are identified in the second column within the "Windows Menu", together with the kind of content that is presented by such a viewer window:
Almost all kinds of viewer windows can be invoked by the help of the viewer menues or by using certain keyboard shortcuts.
Any sort of hypertext document is split by an appropriate parser into a sequence of lines, where each line consists of a mixture of characters and elements (see also the dialog "Browser Settings"). An element is a kind of markup that encloses a group of characters and perhaps other elements, and is used to attach attributes to that group. As a special case, an input element together with its enclosed characters is always treated as a unit and is never broken across lines.
A color attribute can be attached to any element type and may be used to visually distinguish between different kinds of elements (see also the dialog "Color Settings"). During display, the color attributes of inner elements (closer to a character) usually override effects of outer elements in a destructive manner, but non-transparent effects of link-like elements cannot be overridden again by enclosed elements, because such elements play an important role in the interaction with the user and therefore it should not be possible to hide them if not so desired.
Most elements are derived from similar elements of the parsed document.
Many of them have the sole purpose of being an anchor for attaching
<code>. As a special case, heading elements,
<h6>, may additionally be
underlined and may further be used to build a Table of Contents (see
also the pop-up menu "Goto Menu").
An another important type of elements are link elements that
are used to refer to other resources. The additional
attribute holds the URL of such a
resource. Link elements are commonly created from
<area> elements, but they may evenly result from
transformed content, e.g. from
Input elements, also called form
elements, build up an own class of elements. Most of them are used to
hold various kinds of input values that are to be entered or selected by the
user. These values can be sent back to a server on demand, initiated by yet
another input element: a submit button. Input elements are usually created
from related elements of the document, e.g. from
in conjunction with
<form> in case of HTML. Note that in
case of WML, the implementation of input elements does not work in all cases,
because WML variables in general are not evaluated.
The viewer window itself is divided
into four parts: The title of the current document is shown at the top of
the window. A menubar that is located directly above the main subwindow
consists of the five buttons labelled
Menu, and provides
access to common actions and to the viewer
menues. At the bottom, a text input field with label
is provided. It is mainly used like a status bar to display the target of
hyperlinks and similar things, but it is also possible to enter
URLs into this field or to modify its
contents and finally send that for further processing to the main
The rest of the window is covered by the main subwindow and is used to display the hypertext. A cursor is provided to point at locations within the main subwindow, but it is also used to select elements in order to act on them in some way, e.g. to activate a hyperlink. The contents of the main subwindow can be scrolled in all directions, either by using the navigation keys on the keyboard or by dragging the text with the mouse. Many other common operations such as moving the cursor may be performed as well within the main subwindow, and additional assistance is provided by many keyboard shortcuts and by the viewer menues.
Link elements and submit buttons are considered to be links to a resource. When activating such a link by any means, a request is made in order to fetch the associated document, using the request context that has been passed to the viewer. The response that is received as a result is handled in the usual manner and is commonly displayed by either the same or a new viewer window, but it may also result in an invocation of the dialog "Save Document" or certain other windows. In any case, the request context is thereby passed on to the corresponding response handler.
As mentioned before, it is possible to display suitable documents within the same viewer window from which a request is being initiated, instead of always opening a new viewer window for this task. The default behavior can be specified by the help of the dialog "Request Settings".
A local history that is limited to a viewer window allows to switch
between the different documents of a window, but the current display state of
each document (e.g. cursor position, form element values, ...) is not being
preserved. The two additional buttons labelled
Next that are located directly above the main subwindow can be
used to switch immediately to the previous or to the next document in the
history, respectively. Further assistance is provided by the pop-up menu
"History Menu" that allows to switch
to any document of the local history.
An input element is displayed like other elements and shows the current value in some way, depending on its type. It occupies at most one line and is never broken across lines. But, as a consequence, it is usually not possible to change the value of an input element directly, if designated for this action at all. Instead, the element has to be activated first and then, within a certain helper window showing the full element contents, the desired value can be entered or selected. After accepting a new value, it is taken over and is finally shown anew in the hypertext display.
All kinds of input elements and their handling are described in detail in chapter "Form Elements".
It should be noted that the source of a displayed document (in fact the whole response) is internally cached (stored), so that actions that operate on it such as saving the document, viewing its source or displaying it again do not cause that document to be fetched again from the server. This is especially true for responses that result from POST requests. Furthermore, the source of all documents that are referenced by the local history of a viewer window stay cached as long as they can be accessed from that history, independent of other conditions such as memory consumption or response header information.
This internal document cache is generally limited to the displaying
window, but there are certain exceptions to this rule which allow a cached
document to be passed on to other windows. These situations are restricted to
operations that act on the same document and include the evaluation of
hyperlinks that refer to the same document. The destination
URL of such references (the value of
href attribute in HTML) consists of just the fragment part,
<a href="#cache">Document Cacheing</a>
Any other value does not necessarily refer to the same document, especially the responses to POST requests are affected, so that these values always cause the associated document to be fetched again, even if the target URL resolves to that of the current document, e.g.
<a href="index.html#cache">Document Cacheing</a>