DataHubTable

DataHubTable — displays multiple DataHub data points in a single applet.

Description

This is an experimental applet that displays data in a tabular format, similar to a spreadsheet display. The purpose of this applet is to display large amounts of information in rows and columns while still using only a single applet in a web page. This works around limitations in the browser if the browser is unable to display many applets at once.

Base Class

DataHubListener

Parameters

ParameterTypeDefaultDescription
formatstringnullThe default number format for cells in the table.
selectablebooleanfalseDetermines whether cells in the table can be selected with the mouse.
rowsnumber10The number of table rows.
colsnumber2The number of table columns.
gridbooleanfalseDetermines whether the table will display grid lines around the cells.
gridcolorcolornullSpecifies the grid color.
headerbooleantrueDetermines whether the table will have a header containing resizable column headers.
lastcellnumber100The maximum cell number to search when configuring cell contents (see Cell Parameters).
lastclassnumber100The maximum cell class number to search when configuring cell classes (see Cell Parameters).
lastrownumber100The maximum row height number to search when specifying row heights (see Cell Parameters).
widthsstringnullA delimited string containing the pixel widths of all of the columns in the table (see Delimited Strings).
colnamesstringnullA delimited string containing the column names for all of the columns in the table (see Delimited Strings).
doublebufferbooleanfalseDetermines whether the table should be displayed using double-buffer rendering. This eliminates flicker at the cost of higher CPU usage.
cellNstringnullThe Nth cell specification (see Cell Parameters).
fontNstringnullThe Nth cell font specification (see Cell Parameters).
vmapNstringnullThe Nth cell value map (see Cell Parameters).
classNstringnullThe Nth class specification (see Cell Parameters).
cfontNstringnullThe Nth class font specification (see Cell Parameters).
cvmapNstringnullThe Nth class value map (see Cell Parameters).
rowheightNstringnullThe Nth row height specification (see Cell Parameters).
Inherited - - All parameters from DataHubListener

Cell Parameters

The content of the DataHubTable is specified on a cell-by-cell basis. Each non-empty cell has one or more parameters describing its content. These parameters are:

The cell specification is mandatory for each non-empty cell. The font information and value map are both optional.

A cell can be a member of a cell class. This allows you to specify many of the attributes of a cell once, and then repeat that many times for cells in the table. You can then make changes to the class to modify the rendering of all of the cells in the class at once.When the DataHubTable is initially rendered, it searches its parameter list for cell specifications. These are numbered parameters, starting at 1. For example, parameter cell1 is the first non-empty cell, and cell37 could be the 37th non-empty cell. The parameter numbers (1 and 37 in this case) must be unique, but not necessarily contiguous. The DataHubTable will search its parameter space from 1 to lastcell (by default 100) looking for cell specifications. You can change the value of lastcell to broaden the range of acceptable cell numbers.

The content of a cell can be either a string or an image. A string can be the value of a DataHub point, a constant string, or a range-mapped value. A range map uses a DataHub point value to compute the string or image that the cell will display. This is done by specifying a series of point value ranges and the cell classes that will be used to display the cell for each range. As the point value changes, the cell class used to render that cell will be computed based on the range map. For example, you may wish to display the word false when a point value is zero and true when the point value is one.

Delimited Strings

The specification strings for the cellN, fontN, vmapN, classN, cfontN and cvmapN all consist of a string of arguments, separated by delimiters. By default the delimiter character is a semicolon (;). If you wish to have a semicolon as part of any argument in the specification string, you must choose another delimiter. If the specification string starts with any non-alphanumeric character, that character is taken to be the delimiter for the arguments in the string. For example the string one;two:two;3;4 consists of four arguments, separated by semicolons, the default delimiter. The second argument is the string two:two. To specifiy an argument that contains a semicolon, you can choose another delimiter, such as ~one~two;two~3~4. Here the delimiter is the ~ character. Remember that DataHub point names contain colon (:) and decimal (.) characters, so these are not typically good choices for delimiters.

Setting Row Heights

It is possible to set the height of an individual row in the table. This is done by specifying one or more rowheightN parameters, where N is an ordinal number starting at 1. The value of this parameter is a delimited string containing the row number, starting at 1, and the target height in pixels. By default the table searches for row height specifications in the range of 1 to 100. If you would like to specify ordinal numbers for rowheightN above 100, set the table parameter lastrow to a larger number.

Evaluation Order

The DataHubTable does not evaluate its parameters in the order that they appear in the applet definition in your HTML file. The parameter list is searched in a specific order to ensure that class definitions precede cell definitions, and that font and value map parameters are matched to their appropriate cell or class definitions. Parameters that have ordinal numbering (cell, class, vmap, cvmap, font, cfont, rowheight) will always be evaluated from lowest to highest ordinal number, regardless of their position in the parameter list of the applet.

The consequence of this evaluation order is that it does not matter how you arrange the parameters within your HTML file. The order of specification will not affect the order of evaluation.