ModernJava
http://www.modernminds.com
P anel Set Headers

Before reading about WildView panel set headers, you should have already read the WildView Basics topic, and the Panel Sets and Triggers topic.

A panel set header is a special single line of text (a series of characters terminated by a return or line feed) that appears at the beginning of a layout file. WildView panel set headers can be used for two purposes: to enable an automatic refresh of a single panel set, or to enable automatic chaining of multiple panel sets.
R efreshing a Single Panel Set

If you are using WildView to deliver information that can potentially change frequently, you can use a header in your panel set to cause the WildView applet to check for updates at a specific time interval.

To enable automatic refresh for a panel set, you need to insert a header line at the beginning of the layout file with a time indicator and some text that WildView will test. Here's an example:

time=120 Last updated at 10:12 am

<PANEL name=StatusPanel module="WVPanelVScroll" x=25 y=10 w=150 h=80 clock=50 fontSize=14 fontColor=7D3B9D fontStyle=bold>

The accounting system will be unavailable until 11:30 am.

The "time=120" portion of the header line tells WildView that it should check this file every 120 seconds to see if the header line has changed (note that the "time=xx" -- where "xx" is the number of seconds -- can appear anywhere within the line).

In this example, WildView will read the panel set every two minutes and compare the header line with the header line that it read previously. If WildView finds that the header line it has just read is different than the header line read previously, then WildView will update the display.

To force an update, you need only change the text in the header. For instance, in the above example you could change the header to "time=120 Last updated at 11:29 am" and the next time that a WildView applet read the header it would realize that a change had occurred and would update the WildView display. Here's what the modified layout file might look like after the change:

time=120 Last updated at 11:29 am

<PANEL name=StatusPanel module="WVPanelVScroll" x=25 y=10 w=150 h=80 clock=50 fontSize=14 fontColor=7D3B9D fontStyle=bold>

The accounting system is now available.
C haining Panel Sets

The WildViewApplet allows you to specify a list of layout files to which WildView will have access. By placing a header line in each layout file with a time indicator, you can cause the WildView applet to cycle, or "chain," through the available layout files and to display each panel set for a pre-defined period of time.

One use of chaining is to implement an advertising application. Each panel set might contain a layout for a particular ad. By setting a time to display each ad, you can automatically cycle through the ads.

To illustrate chaining, we'll design a trivial WildView display that cycles between two panel sets.

The first panel set (HeaderDemo1.TXT) will be similar to the one we developed in the Panel Sets and Triggers topic, except that we will use the WVPanelTeletype module to display the article text. Here is the layout for the first panel set:

time=30

<!-- This panel set will be displayed for 30 seconds, then the next panel set (HeaderDemo2.TXT) will be loaded.>

<!-- The following panel tag creates a static text area where the headline will be displayed.>

<PANEL name=Headline module="WVPanelText" x=5 y=0 w=190 h=20 fontSize=14 fontColor=FF0000 fontStyle=bold justify=center>

<!-- The panel tag below creates a teletype style text area that displays the article text.>

<PANEL name=Articles module="WVPanelTeletype" x=5 y=20 w=190 h=75 clock=65 fontSize=14 fontColor=7D3B9D cursorColor=686EE0 cursorCharColor=FFFFFF>

<TRIGGER panel=Headline text="First Panel Set">
This panel set will be displayed for 30 seconds.<P>

<WAIT timeout=1>

<TRIGGER panel=Headline text="Asynchronous Loading">
When the display time limit expires for this panel set, the next panel set will begin to load as a background task.

Notice the "time=30" line at the beginning of the panel set. This tells the WildView applet to display this panel set for 30 seconds. The display time can be set to any number of seconds that you desire.

The layout for the second panel set (HeaderDemo2.TXT) will be a single panel that implements a simple horizontal scroller. It too will be displayed for 30 seconds.

time=30

<!-- This panel set will be displayed for 30 seconds, then the next panel set (HeaderDemo1.TXT) will be loaded>

<!-- The panel tag below creates a horizontally scrolling text area>

<PANEL name=Scroller module="WVPanelHScroll" x=0 y=10 w=200 h=80 clock=50 fontSize=24 fontColor=7D3B9D fontStyle=bold justify=middle rate=2>

This is the second panel set. After 30 seconds, the first panel set will be re-loaded.

Next we present the applet tag that ties this all together:

<APPLET CODE="WildViewApplet.class" WIDTH="200" HEIGHT="100">
<PARAM NAME="panelSet1" VALUE="DocPanelSets/HeaderDemo1.TXT">
<PARAM NAME="panelSet2" VALUE="DocPanelSets/HeaderDemo2.TXT">
</APPLET>

And finally, here is the working applet:

Copyright © 1997 by Modern Minds, Inc.