Hardware Reference
In-Depth Information
function init(&$appMan)
{
Warp_Applet::Init($appMan);
}
function renderPanel(&$appMan)
{
return "";
}
function renderWindow(&$appMan)
{
return "";
}
function renderInfo(&$app_man, $fast=false)
{
if ($fast) {
return "-";
}
return "Instructions...";
}
}
?>
You can easily see the blanks in which you fill the HTML code to form the panel, main window, and help screen. These
are the easy bits. The interesting code is in init and the hitherto unseen getRefreshParams that control the parameters.
TODO: Controlling the Applet
With everything being controlled by parameters, you must take care to use them effectively. The best way to do this
is to think of the GET request as featuring two sets of parameters. The first set reflects the refresh parameters and are
those that you'd want to appear in the URL so that this state could be rebuilt at a later date. The second set is the
command parameters, indicating how that state is to change when the page is reloaded.
In the TODO example, your applet should be able to list the to-do list for the current user or the public and
optionally be able to sort it alphabetically. 7 This will ultimately provide you with five potential parameters:
u Refresh state parameter : Which user is visible?
u Refresh state parameter : Is the list sorted?
u Command argument : Switch to user X.
u Command argument : Sort list.
u Command argument : Unsort list (aka, show in order).
This demonstrates the next point—there is redundancy here. It is technically possible to combine the refresh
state and command parameter in one, as they both control the same data. However, when you are building a web
page, you need to know all the refresh state parameters so that the other links on the page have the correct values.
4OCORRECTLYDELETEANENTRYFROMTHE4/$/LISTYOUÈ€DNEEDTOLOCKTHEFILEINCASETHEFILEGOTCORRUPTEDWHENTWOPEOPLETRIEDTO
DELETEATTHESAMETIME)HAVEATRULYMARVELOUSSOLUTIONTOTHISWHICHTHISMARGINISTOONARROWTOCONTAIN
Search WWH ::




Custom Search