blob: 530062b905fd15b4ac9eeca2523d18e1e766760a [file] [log] [blame]
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>DIODisplay</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.1"><link rel="up" href="diodisplay.html" title="DIODisplay - Database Interface Objects Display Class"><link rel="prev" href="diodisplay.html" title="DIODisplay - Database Interface Objects Display Class"><link rel="next" href="session_package.html" title="Session Package"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">DIODisplay</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="diodisplay.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">DIODisplay - Database Interface Objects Display Class</th><td width="20%" align="right"> <a accesskey="n" href="session_package.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div><div class="refentry"><a name="diodisplay_package"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>DIODisplay — Database Interface Objects Display Class</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">DIODisplay</span> (<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>objectName</code></em></span> | <span style="font-family:monospace; font-weight: bold;">#auto</span>) (<span style="font-family:monospace; font-weight: bold;">-option</span> | <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>option</code></em></span> | <span style="font-family:monospace; font-weight: bold;">-option</span> | <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>option</code></em></span> | <span style="font-family:monospace; font-weight: bold;">...</span>)</div></div></div><div class="refsect1"><a name="idm2687"></a><h2>Description</h2><p style="width:90%">
DIODisplay is an HTML display class that uses a DIO object
to do the database work and a form object to do the
displaying.
</p></div><div class="refsect1"><a name="idm2690"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-DIO</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>dioObject</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
The DIO object to be used in conjunction with this
display object. This is a required field.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-cleanup</span> (<span style="font-family:monospace; font-weight: bold;">1</span> | <span style="font-family:monospace; font-weight: bold;">0</span>)</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
If cleanup is true, when the display object is shown,
it will automatically destroy the DIO object, the form
object and itself. Default is true.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-confirmdelete</span> (<span style="font-family:monospace; font-weight: bold;">1</span> | <span style="font-family:monospace; font-weight: bold;">0</span>)</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
If confirmdelete is true, attempting to delete a
record from the database first requires that the user
confirm that they wish to delete it. If it is false,
deletion occurs without prompting the user. Defaults
to true.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-errorhandler</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>procName</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
The name of a procedure to handle errors when they
occur. During the processing of requests and pages,
sometimes unexpected errors can occur. This procedure
will handle any errors. It is called with a single
argument, the error string. Use of the Tcl errorInfo
and errorCode variables is also recommended though.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
If no errorhandler is specified, the handle_error
method within the Display object will handle the
error.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-fields</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>fieldList</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Specify a list of fields to be used in this object.
The fields list is actually created by using the
<span style="font-family:monospace"><span class="command"><strong>field</strong></span></span> command to add fields to the
display, but this option can be useful to sometimes
over-set the list of fields created.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-form</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>formObject</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
A Rivet form object to use when displaying a form. If
one is not specified, the display object will
automatically create one when it is necessary.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-functions</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>functionList</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
A list of functions to be displayed in the main menu.
This is a list of functions the user is allowed to
execute.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-pagesize</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>pageSize</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
How many records to show per page on a search or
list. Default is 25.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-rowfields</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>fieldList</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
A list of fields to display in each row of a search or
list. When a search or list is conducted and the
resulting rows are displayed, this list will limit
which fields are displayed. Default is all fields.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-rowfunctions</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>functionList</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
A list of functions to display in each row of a search
or list.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-searchfields</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>fieldList</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
A list of fields to allow a user to search by. This
list will appear in the main screen as a drop-down box
of fields the user can search on.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-title</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>title</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
The title of the display object. This will be output
as the title of the HTML document.
</div></div></dd></dl></div><div class="refsect2"><a name="idm2793"></a><h3>DIO Display Object Commands</h3><div class="variablelist"><dl class="variablelist"><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">cleanup</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current cleanup value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for the cleanup
option.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">delete</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>key</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Delete the specified key from the
database.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
The default action of this method is to call the DIO
object's delete command. This method can be
overridden.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">destroy</span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Destroy the diodisplay object.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">DIO</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current DIO value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for DIO.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">errorhandler</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current errorhandler value. If
<em class="replaceable"><code>value</code></em> is specified, it
sets a new value for errorhandler.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">fetch</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>key</code></em></span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>arrayName</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Fetch the specified <em class="replaceable"><code>key</code></em>
from the database and store it as an array in
<em class="replaceable"><code><em class="replaceable"><code>arrayName</code></em></code></em>.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
The default of this method is to call the DIO object's fetch command.
This method can be overridden.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">field</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>fieldName</code></em></span> (<span style="font-family:monospace; font-weight: bold;">-arg</span> | <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>arg</code></em></span>...)</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Create a new field object and add it to the display.
When a field is added to the display, a new object
of the DIODisplayField class is created with its
values. See [FIXME - LINK] DIO Display Fields for
options and values.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">fields</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current fields value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for fields.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">form</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current form value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for form.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">function</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>functionName</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Add a new function to the list of possible
functions. The display object will only execute
methods and procs which are defined as functions by
the object. This is to protect the program from
executing a different procedure other than what is
allowed. The <span style="font-family:monospace"><span class="command"><strong>function</strong></span></span> command
adds a new function to the list of allowable
functions.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">functions</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current functions value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for functions. See
[FIXME - LINK DIO Display Functions] for a list of
default functions.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">pagesize</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current form pagesize. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for pagesize.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">rowfields</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current form rowfields. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for rowfields.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">rowfooter</span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Output the footer of a list of rows to the web page.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
This method can be overridden.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">rowfunctions</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current rowfunctions value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for rowfunctions.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">rowheader</span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Output the header of a list of rows to the web page.
By default, this is an HTML table with a top row
listing the fields in the table.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
This method can be overridden.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">searchfields</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current searchfields value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for searchfields.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">show</span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Show the display object.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
This is the main method of the display class. It
looks for a variable called <code class="varname">mode</code>
to be passed in through a form response and uses
that mode to execute the appropriate function. If
mode is not given, the <span style="font-family:monospace"><span class="command"><strong>Main</strong></span></span>
function is called.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
This function should be called for every page.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">showform</span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Display the form of the object.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
This method displays the form for this display
object. It is used in the <span style="font-family:monospace"><span class="command"><strong>Add</strong></span></span>
and <span style="font-family:monospace"><span class="command"><strong>Edit</strong></span></span> methods but can be
called separately if needed.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
This method can be overridden if the default look of
a form needs to be changed. By default, the form
displayed is simply the fields in a table, in order.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">showrow</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>arrayName</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Display a single row of a resulting list or search.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
This method is used to display a single row while
displaying the result of a list or search.
<em class="replaceable"><code>arrayName</code></em>
is a fetched array of the record.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
This method can be overriden if the default look of
a row needs to be changed. By default, each row is
output as a table row with each field as a table
data cell.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">showview</span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Display the view of the object.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
This method displays the view for this display
object. It is used in the
<span style="font-family:monospace"><span class="command"><strong>Details</strong></span></span> methods but can be
called separately if needed.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
This method can be overridden if the default look of
a view needs to be changed. By default, the view
displayed is simply the fields in a table, in order.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">store</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>arrayName</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Store the specified
<em class="replaceable"><code>arrayName</code></em>
in the database.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
The default of this method is to call the DIO
object's store command. This method can be
overridden.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">text</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current text value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for text.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">title</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current title value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for title.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">type</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current type value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for type.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>objectName</code></em></span> <span style="font-family:monospace; font-weight: bold;">value</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>value</code></em></span>?</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Return the current value value. If
<em class="replaceable"><code>value</code></em> is
specified, it sets a new value for value.
</div></div></dd></dl></div></div><div class="refsect2"><a name="idm3106"></a><h3>DIO Display Functions</h3><p style="width:90%">
These functions are called from the
<span style="font-family:monospace"><span class="command"><strong>show</strong></span></span> method when a form response
variable called <code class="varname">mode</code> is set. If no
mode has been set, the default mode is
<span style="font-family:monospace"><span class="command"><strong>Main</strong></span></span>. The show method will handle
the necessary switching of functions. The show method
also handles checking to make sure the function given is a
true function. If not, an error message is displayed.
New functions can be added as methods or by use of the
<span style="font-family:monospace"><span class="command"><strong>function</strong></span></span> command, and any of the
default functions can be overridden with new methods to
create an entirely new class. These are the default
functions provided.
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span style="font-family:monospace"><span class="command"><strong>Add</strong></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Show a form that allows the user to add a new entry
to the database. This function calls
<span style="font-family:monospace"><span class="command"><strong>showform</strong></span></span> to display the form
for adding the entry.
</div></div></dd><dt><span class="term"><span style="font-family:monospace"><span class="command"><strong>Cancel</strong></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
The <span style="font-family:monospace"><span class="command"><strong>Cancel</strong></span></span> function does nothing
but redirect back to the <span style="font-family:monospace"><span class="command"><strong>Main</strong></span></span>
function. This is handy for forms which have a
cancel button to point to.
</div></div></dd><dt><span class="term"><span style="font-family:monospace"><span class="command"><strong>Delete</strong></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
If <code class="varname">confirmdelete</code> is true (the
default), the <span style="font-family:monospace"><span class="command"><strong>Delete</strong></span></span> function
will ask the user if they're sure they want to
delete the record from the database. If
<code class="varname">confirmdelete</code> is false, or if the
user confirms they wish to delete, this function
calls the <span style="font-family:monospace"><span class="command"><strong>DoDelete</strong></span></span> function to do
the actual deletion of a record.
</div></div></dd><dt><span class="term"><span style="font-family:monospace"><span class="command"><strong>Details</strong></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Display the view of a single record from the database. This function calls
the <span style="font-family:monospace"><span class="command"><strong>showview</strong></span></span> method to display a single record from the database.
</div></div></dd><dt><span class="term"><span style="font-family:monospace"><span class="command"><strong>DoDelete</strong></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
This function actually deletes a record from the
database. Once it has deleted the record, it
redirects the user back to the
<span style="font-family:monospace"><span class="command"><strong>Main</strong></span></span> function.
</div></div></dd><dt><span class="term"><span style="font-family:monospace"><span class="command"><strong>Edit</strong></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
Show a form that allows the user to edit an existing
entry to the database. This function calls
<span style="font-family:monospace"><span class="command"><strong>showform</strong></span></span> to display the form for
editing the entry and fills in the fields with the
values retrieved from the database.
</div></div></dd><dt><span class="term"><span style="font-family:monospace"><span class="command"><strong>List</strong></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
This function lists the entires contents of the
database. Each record is output in a row using the
<span style="font-family:monospace"><span class="command"><strong>showrow</strong></span></span> method.
</div></div></dd><dt><span class="term"><span style="font-family:monospace"><span class="command"><strong>Main</strong></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
This function is the main function of the display
object. If there is no mode, or once most commands
complete, the user will be redirected to this
function. The default <span style="font-family:monospace"><span class="command"><strong>Main</strong></span></span>
function displays a list of functions the user can
execute, a list of searchfields the user can search
on, and a query field. This query field is used by
all of the other functions to determine what the
user is trying to find.
</div><div style="margin-bottom:1.5ex ; padding .5ex">
In the case of a <span style="font-family:monospace"><span class="command"><strong>search</strong></span></span>, query
specifies what string the user is looking for in the
specified search field. In the case of
<span style="font-family:monospace"><span class="command"><strong>delete</strong></span></span>,
<span style="font-family:monospace"><span class="command"><strong>details</strong></span></span> or
<span style="font-family:monospace"><span class="command"><strong>edit</strong></span></span>, the query specifies the
database key to access.
</div></div></dd><dt><span class="term"><span style="font-family:monospace"><span class="command"><strong>Save</strong></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
This function saves any data passed to using the
<span style="font-family:monospace"><span class="command"><strong>store</strong></span></span> method. This is primarily
used by the <span style="font-family:monospace"><span class="command"><strong>add</strong></span></span> and
<span style="font-family:monospace"><span class="command"><strong>edit</strong></span></span> commands to store the
results of the form the user has filled out.
</div></div></dd><dt><span class="term"><span style="font-family:monospace"><span class="command"><strong>Search</strong></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
This function searches the database for any row
whose <code class="varname">searchBy</code> field matches
<code class="varname">query</code>. Once any number of records
are found, <span style="font-family:monospace"><span class="command"><strong>Search</strong></span></span> displays the
results in rows.
</div></div></dd></dl></div></div><div class="refsect2"><a name="idm3187"></a><h3>DIO Display Fields</h3><p style="width:90%">
Display fields are created with the
<span style="font-family:monospace"><span class="command"><strong>field</strong></span></span> command of the DIODisplay object.
Each field is created as a new DIODisplayField object or
as a subclass of DIODisplayField. The standard form
fields use the standard field class, while specialized
field types use a class with different options but still
supports all of the same commands and values a generic
field does.
</p><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace"><em class="replaceable"><code>displayObject</code></em></span> <span style="font-family:monospace; font-weight: bold;">field</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>fieldname</code></em></span> (<span style="font-family:monospace; font-weight: bold;">-option</span> | <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>option</code></em></span>...)</div></div><p style="width:90%">
These are the standard options supported by field types:
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-formargs</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>arguments</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
When a field is created, any argument which is not a
standard option is assumed to be an argument passed
to the form object when the field is shown in a
form. These arguments are all appended to the
<code class="varname">formargs</code> variable. You can use
this option to override or add options after the
initial creation of an object
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-readonly</span> (<span style="font-family:monospace; font-weight: bold;">1</span> | <span style="font-family:monospace; font-weight: bold;">0</span>)</div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
If <code class="varname">readonly</code> is set to true, the
field will not display a form entry when displaying
in a form.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-text</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>text</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
The text displayed next to the form or view field.
By default, DIODisplay tries to figure out a pretty
way to display the field name. This text will
override that default and display whatever is
specified.
</div></div></dd><dt><span class="term">
<div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "> <span style="font-family:monospace; font-weight: bold;">-type</span> <span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>fieldType</code></em></span> </div></div>
</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
The type of field this is. This type is used when
creating the field in the form object.
<em class="replaceable"><code>fieldType</code></em>
can be any of the accepted form field types. See
[FIXME - LINK DIO Field Types] for a list of types
available.
</div></div></dd></dl></div><p style="width:90%">
All other arguments, unless specified in an individual
field type, are passed directly to the form object when
the field is created. So, you can pass
-size or -maxsize to
specify the length and maximum length of the field entry.
Or, if type were textarea, you could define
-rows and -cols to
specify its row and column count.
</p></div><div class="refsect2"><a name="idm3245"></a><h3>DIO Display Field Types</h3><p style="width:90%">
The following is a list of recognized field types by
DIODisplay. Some are standard HTML form fields, and
others are DIODisplay fields which execute special actions
and functions.
</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="diodisplay.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="diodisplay.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="session_package.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">DIODisplay - Database Interface Objects Display Class </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Session Package</td></tr></table></div></body></html>