next up previous
Next: More about Behaviour
Up: The WOM language
Previous: Attribute declarations

The Book class; paths; instance links


The <Class Top Book> not only causes the generated class to be named Top, but also to be a subclass of Book. This is a built-in class which has a ``current page'' attribute changeable either from code inserts, or by <InstanceSelectionLink> elements as above. The reason for having this class was to make it easy to send back different pages from one form. This can be tricky in normal CGI programming, because the URL that identifies the form's output page is fixed, having to be specified (as an ``action URL'') when the form is written.

Before going any further, we need to point out that, in the element

<InstanceSelectionLink instance=Menus book=ROOT>
the instance and book attributes both refer to instances. Menus denotes the ``Menus'' page, and ROOT denotes the root or top level instance of the application. Both are examples of paths --- hierarchical names for instances --- which are described further in Section 2.19.

The <InstanceSelectionLink> element is an example of an instance link: an element which, when clicked on, causes another instance to be displayed. This is how the author can set URLs to point at one part of an application from another.

In fact, an <InstanceSelectionLink> not only causes a new instance to be displayed, but also makes it the current page of a book. Clicking on the instance selection link for Fact, for example, would set the current page to Fact and then send back that current page's HTML. If no current page is set, a book will send back its own HTML. There is also an <InstanceLink> which links to an instance but does not select it into a book.

Jocelyn Ireson-Paine
Fri May 30 14:03:06 BST 1997