.\" Automatically generated by Pod::Man version 1.15
.\" Wed May 5 11:41:33 2004
.\"
.\" Standard preamble:
.\" ======================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
.\" to do unbreakable dashes and therefore won't be available. \*(C` and
.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr
.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
.\" index entries marked with X<> in POD. Of course, you'll have to process
.\" the output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it
.\" makes way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
.bd B 3
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ======================================================================
.\"
.IX Title "ictable_editor 8"
.TH ictable_editor 8 "Interchange 5.2.0" "2004-05-05" "Interchange"
.UC
.SH "NAME"
icconfig \- Configuration Reference
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
.SH "Interchange Table Editor"
.IX Header "Interchange Table Editor"
Interchange has a powerful, highly-configurable table editor
application implemented via its [table-editor] ... tag.
.PP
It is called in an Interchange page as simply as:
.PP
.Vb 1
\& [table-editor cgi=1]
.Ve
Given that call, it reads the passed \s-1CGI\s0 query information and builds
a table editor for an interchange table.
.PP
Each field within the table editor is completely configurable for \s-1HTML\s0
widget type, label, help links, and more. These configurations can be
saved in the mv_metadata database, or can be specified in the
table-editor tag call itself.
.PP
The table editor is portable. It will work with any \s-1DBI/SQL\s0 database,
with \s-1LDAP\s0 databases, and with Interchange \s-1DBM\s0 and plain-file
databases.
.PP
Much of the Interchange administrative user interface (\s-1UI\s0) is built
around the table editor.
.PP
Its features include:
.Ip "Complete range of widgets and data filters" 4
.IX Item "Complete range of widgets and data filters"
.PP
Interchange has 18 different \s-1HTML\s0 widget types with data filters to
condition the data.
.Ip "Link fields from any table" 4
.IX Item "Link fields from any table"
.PP
Though the table editor uses one table as its base, fields from other
tables can be brought in, and entire sets of records relationally
linked to the base record can be edited within the table editor.
.Ip "Tabbed display" 4
.IX Item "Tabbed display"
.PP
Interchange automatically builds a tabbed interface from your fields
specification.
.if n .Ip """""Wizard"""" mode" 4
.el .Ip "``Wizard'' mode" 4
.IX Item ""Wizard mode"
.PP
The table editor has a \*(L"wizard\*(R" mode that can collect information for
accomplishing installation or setup tasks, with Next, Back, Cancel and
Finish modes.
.Ip "Templatable setup" 4
.IX Item "Templatable setup"
.PP
You can completely control the way the table editor displays the
widgets without interfering with its functionality.
.Ip "Complex data structures" 4
.IX Item "Complex data structures"
.PP
Interchange can build arbitrarily-deep data structures from form
input. The collected data is serialized with the equivalent of Perl's
Data::Dumper and stored in a single database field.
.Sh "Calling the table editor"
.IX Subsection "Calling the table editor"
In its simplest form, table-editor is called in an \s-1ITL\s0 page with:
.PP
.Vb 1
\& [table-editor table=products key=os28004][/table-editor]
.Ve
That will edit the table products using its default configuration, for
the \s-1SKU\s0 os28004.
.PP
If no metadata is defined for the table, all fields are edited. To
limit it with the tag call:
.PP
.Vb 4
\& [table-editor
\& table=products
\& key=os28004
\& fields="sku price description" ][/table-editor]
.Ve
To specify that the field description should have a different widget
type, height, and width, you can specify:
.PP
.Vb 8
\& [table-editor
\& table=products
\& key=os28004
\& fields="sku price description"
\& widget.description=textarea
\& width.description=50
\& height.description=10
\& ][/table-editor]
.Ve
If you do this with the default foundation demo catalog, you will
see:
.PP
.Vb 1
\& SKU __________________________________
.Ve
.Vb 1
\& Product Price __________
.Ve
.Vb 6
\& +---------------------------------------------+
\& | |
\& Short | |
\& Description | |
\& | |
\& +---------------------------------------------+
.Ve
Note that the labels are pulled from the mv_metadata definition \-\-
any attributes not specified in the options do that. You can override
each in turn \*(-- to change \s-1SKU\s0 to \*(L"Part Number\*(R" you can do:
.PP
.Vb 4
\& [table-editor
\& table=products
\& key=os28004
\& fields="sku price description"
.Ve
.Vb 1
\& label.sku="Part number"
.Ve
.Vb 4
\& widget.description=textarea
\& width.description=50
\& height.description=10
\& ][/table-editor]
.Ve
To change the style of the label column, you can set the style
information with:
.PP
.Vb 4
\& [table-editor
\& table=products
\& key=os28004
\& fields="sku price description"
.Ve
.Vb 1
\& label_cell_style="font-weight: bold"
.Ve
.Vb 5
\& label.sku="Part number"
\& widget.description=textarea
\& width.description=50
\& height.description=10
\& ][/table-editor]
.Ve
This should \fBbold\fR the label text.
.PP
These are just a few small examples. There are more than 150 options
for table editor which we will discuss below.
.Sh "Attributes and attribute quoting"
.IX Subsection "Attributes and attribute quoting"
The [table-editor] is capable of accepting a large number of
attributes. It uses standard \s-1ITL\s0 tag quoting, explained in the
\&\fIInterchange Tag Reference\fR.
.PP
You can quote with single-quote (<'>), double-quote ("), backtick
(`), or pipe (|). Material placed in backticks is run through a
safe Perl interpreter. In fact, it is the equivalent of using the
[calc] [/calc] tag pair except that contained \s-1ITL\s0 tags are not
interpolated.
.PP
Pipe-quoting has the attribute of stripping trailing and leading
whitespace; it is often convenient when specifying JavaScript (which
uses both single and double quotes frequently) in the various
*_extra parameters.
.Sh "Templating"
.IX Subsection "Templating"
The [table-editor] is templated on several levels. In the most basic
use, where you rely on it to build the table rows, there is the
row_template option. By default, it is:
.PP
.Vb 17
\&
.Ve
The values of \f(CW$opt\fR->{*_cell_extra} are constructed from the
*_cell_class,
.Ip "\(bu" 4
_cell_width, *_cell_valign, *_cell_align, *_cell_style, and
*_cell_extra options. You can watch the effect by trying different
settings:
.Sp
.Vb 1
\& [table-editor
.Ve
.PP
The values specified with {\s-1LABEL\s0}, {\s-1WIDGET\s0}, etc. are what are used to
substitute the widget values constructed from the metadata. A
perfectly functional template would be:
.PP
{\s-1LABEL\s0}
{\s-1WIDGET\s0}
.PP
That would show the label and widget without any help being shown
(even if it is available) and using the default styles for at table
data cell.
.PP
There is also the overall template, which is passed as the container
text for [table-editor]. Something equivalent to the default can be
achieved with:
.PP
{\s-1TOP_OF_FORM\s0} {\s-1HIDDEN_FIELDS\s0}
{\s-1TOP_BUTTONS\s0}
{:REST}
{\s-1BOTTOM_BUTTONS\s0}
{\s-1BOTTOM_OF_FORM\s0}
.PP
There are two other templates \*(-- the break_template and the
combo_template. See \*(L"Templates\*(R".
.Sh "Metadata"
.IX Subsection "Metadata"
Interchange's foundation demonstration catalog and \s-1UI\s0 rely on a table
named mv_metadata, which contains the definitions for table and
field appearance. This table is supported with a table definition
editor (pages/admin/db_metaconfig) and a field definition editor
(pages/admin/meta_editor).
.PP
The mv_metadata table has the following fields:
.Ip "code" 4
.IX Item "code"
.PP
The key for the table. Normally, it takes the form
.PP
.Vb 1
\& table::column
.Ve
where table is the table the field is contained in, and column is the
table column name. It can also take the forms:
.PP
.Vb 3
\& view::table::column::key
\& view::table::column
\& table::column::key
.Ve
Each is checked in turn to see if it exists, then applied. If none of
the above is found, then the field is displayed with a default widget
(a text box with size 50).
.Ip "type" 4
.IX Item "type"
.PP
The widget type. The following, at least, are supported:
.PP
.Vb 25
\& Type Name Description
\& text Text entry The normal HTML text entry field.
\& textarea Textarea The normal HTML textarea entry for putting in multiple lines of data.
\& select Select box Also known as as a dropdown menu. Interchange has many ways to populate the options via automatic database lookup, and you can specify options to add or replace a lookup.
\& yesno Yes/No (Yes=1) A dropdown/select looking for a Yes (1) or No (0) answer.
\& noyes No/Yes (No=1) A dropdown/select looking for a Yes (0) or No (1) answer.
\& yesno radio Yes/No (radio) Same as the yesno widget except implmented with a radio box.
\& noyes radio No/Yes (radio) Same as the noyes widget except implmented with a radio box.
\& multiple Multiple Select A dropdown/select with SIZE greater than 1.
\& combo Combo Select A dropdown/select with a preceding text entry field that can add a new entry. Needs the nullselect filter; usually combined with a lookup.
\& reverse_combo Reverse Combo A dropdown/select with a following text entry field that can add a new entry. Needs the last_non_null filter; usually combined with a lookup.
\& move_combo Combo move A dropdown select that sends clicked items to a textarea.
\& display Text of option Displays the label (only) for a select/radio choice.
\& hidden_text Hidden (show text) Shows the value of a field and includes a hidden field to put the value in the form. Usually used when you want to display a key for a record but not give the opportunity to change it (and create a new record).
\& radio Radio box Select one of many options with a check box. Usually can be used instead of a select; can be grouped in matrices.
\& radio_nbsp Radio (nbsp) Select one of many options with a check box. Usually can be used instead of a select; can be grouped in matrices. This version puts no spaces in the outputted HTML, guaranteeing no wrap. (You can use the newer nowrap styles in CSS instead, often.)
\& checkbox Checkbox Select one or more options with a checkbox. Usually can be used instead of a multiple select.
\& check_nbsp Checkbox (nbsp) Select one or more options with a checkbox. Usually can be used instead of a multiple select. This version puts no spaces in the outputted HTML, guaranteeing no wrap. (You can use the newer nowrap styles in CSS instead, often.)
\& imagedir Image listing Shows a list of already existing images in a directory, with a link to a dialog to upload a new one.
\& imagehelper Image upload Combines input of an image name along with upload of the image.
\& date Date selector Selects a date, with optional time. Used in combination with the date_change filter.
\& value Value Simply shows the value of the field, with no widget to set it.
\& option_format Option formatter
\& show Show all options Shows all options for a select/radio/checbox type input, without a widget to set the value.
\& uploadhelper File Uppload Puts the contents of a file upload in the named variable. Can be used as filter.widget="upload"
.Ve
These widgets are implemented with the Vend::Form module, and are
discussed in more detail later in this document.
.Ip "width" 4
.IX Item "width"
.PP
The width of the widget. Meaningful in some way for most types.
.Ip "height" 4
.IX Item "height"
.PP
In the field metadata, it is meaningful for textarea, multiple select
types (including the combo widgets), and for groups of radio and
checkboxes.
.PP
In the table metadata context, defines the number of rows that will be
shown on the record select page before a \*(L"more\*(R" list will be built.
.Ip "field" 4
.IX Item "field"
.PP
The fields for an options lookup query if more than one. Default is
none \*(-- the field in \*(L"lookup\*(R" is used.
.Ip "db" 4
.IX Item "db"
.PP
The table to do the lookup query in. Default is the same table as the
column is in.
.Ip "name" 4
.IX Item "name"
.PP
The name of the generated \s-1HTML\s0 form element. Default is the same name
as the column for the widget.
.Ip "outboard" 4
.IX Item "outboard"
.PP
Catchall field used in several ways by different widgets. Normally
used to specify a foreign key, it can also contain a directory name or
other information needed for a widget.
.Ip "options" 4
.IX Item "options"
.PP
Hard-coded options for the select, checkbox, and radio box widget
types.
.Ip "attribute" 4
.IX Item "attribute"
.PP
Not normally used for table editor. Used in Interchange in the context
of an [item-list ...] for generating option names.
.Ip "label" 4
.IX Item "label"
.PP
The label associated with the field for display in the table editor.
In the below example, \*(L"Foo\*(R" is the label:
.PP
.Vb 1
\& Foo:
.Ve
.Ip "help" 4
.IX Item "help"
.PP
Inline help to be displayed in the table editor.
.Ip "lookup" 4
.IX Item "lookup"
.PP
A field name to look up options in. Normally this would be the same
field as the widget, to generate a list of unique values. The
equivalent to the query:
.PP
.Vb 1
\& SELECT DISTINCT foo FROM table ORDER BY foo
.Ve
is done.
.Ip "filter" 4
.IX Item "filter"
.PP
A filter which should be applied to the data coming from a widget
before saving in the database. A few examples of the dozens of
standard filters are:
.RS 4
.Ip "nullselect" 8
.IX Item "nullselect"
.RE
.RS 4
.Sp
Select first non-null from \s-1HTML\s0 fields, used for combo box widget
.RS 4
.RE
.Ip "digits_dot" 8
.IX Item "digits_dot"
.RE
.RS 4
.Sp
Helps keep currency symbols and punctuation from polluting decimal
values.
.RS 4
.RE
.Ip "uc" 8
.IX Item "uc"
.RE
.RS 4
.Sp
Uppercases the data.
.RS 4
.RE
.Ip "\s-1NN\s0" 8
.IX Item "NN"
.RE
.RS 4
.Sp
Where \s-1NN\s0 is an integer. A number that limits length of input.
.RE
.PP
There are many more filters, and it is easy to specify custom filters.
See Interchange's filters documentation.
.Ip "help_url" 4
.IX Item "help_url"
.PP
A \s-1URL\s0 for extended help on a field.
.Ip "pre_filter" 4
.IX Item "pre_filter"
.PP
For advanced use only. Specifies a filter that is run on the data
before it is used to set the widget value. Not normally used.
.Ip "lookup_exclude" 4
.IX Item "lookup_exclude"
.PP
A regular expression that can exclude certain values from a lookup
list.
.Ip "prepend" 4
.IX Item "prepend"
.PD 0
.Ip "append" 4
.IX Item "append"
.PD
.PP
Valuse that are prepended and appended to the widget \s-1HTML\s0, perhaps to
call an external formatter or tool.
.Ip "display_filter" 4
.IX Item "display_filter"
.PP
Not normally used.
.Ip "default" 4
.IX Item "default"
.PP
The default value that should be given to a column when it is of
length zero.
.Ip "extended" 4
.IX Item "extended"
.PP
The repository for the serialized extended values set in metadata.
.Sh "Extended settings"
.IX Subsection "Extended settings"
Interchange's meta editors use the table editor's serialization
capability to set many more than just the fields mentioned above.
There are over 150 different metadata settings, and it would be
impossible to have each occupy a field in a table.
.PP
Many of these settings can be passed in a \s-1CGI\s0 query string if the
cgi=1 option is specified.
.Ip "across" 4
.IX Item "across"
.PP
The number of label-widget pairs which should be placed on each table
row. The default is 1. Not passable by \s-1CGI\s0.
.Ip "action" 4
.IX Item "action"
.PP
The Interchange form action to use for the generated form. In normal
mode, the default is \*(L"set\*(R". In wizard mode, the default is \*(L"return\*(R".
Not passable by \s-1CGI\s0.
.Ip "action_click" 4
.IX Item "action_click"
.PP
An mv_click action that should be run on the Wizard next function. The
default is \*(L"ui_override_next\*(R", which is usually a no-op on most
systems. Not passable by \s-1CGI\s0.
.Ip "all_errors" 4
.IX Item "all_errors"
.PP
Specifies that all form field entries should be checked for errors and
their label fields set to the \s-1CONTRAST\s0 setting if an error is found.
.Ip "all_opts" 4
.IX Item "all_opts"
.PP
An \s-1ITL\s0 tag option that specifies that the table-editor options should
be retrieved from one source.
.PP
If the option is a \s-1HASH\s0 reference, it will be used directly as a
structure that will set all options.
.PP
If it is a scalar value, it will be used as a key to select the
mv_metadata record which contains the options.
.Ip "append" 4
.IX Item "append"
.PP
Active for every column in ui_data_fields. A value containing \s-1HTML\s0
which should be appended to the widget \s-1HTML\s0.
.Ip "auto_secure" 4
.IX Item "auto_secure"
.PP
Instructs Interchange to build a write enable only for the tables,
columns, and keys that are specified in the table-editor call. Note
that you can allow unfettered writes by setting the scratch variable
mv_data_enable, but that it is rarely right to do so.
.PP
This prevents people from hacking together a duplicate of the
[table-editor] form and writing columns or records they shouldn't.
.PP
This option is automatically disabled if the cgi option is enabled.
Still, you should pay attention to what you are allowing users to
write to your database.
.Ip "back_text" 4
.IX Item "back_text"
.PP
The text that should be used in the Wizard \fBBack\fR button.
Automatially translated for locale.
.Ip "bottom_buttons" 4
.IX Item "bottom_buttons"
.PP
Indicates that buttons should always be only on the bottom. Normally,
[table-editor] provides a top row of buttons if more than four rows
are in the table.
.Ip "break_cell_extra" 4
.IX Item "break_cell_extra"
.PP
Extra \s-1HTML\s0 attributes for the table cell in the standard break_row
template. You might pass a valign, align, class, or other attribute:
.PP
.Vb 1
\& break-cell-extra=|class="myclass"|
.Ve
.Ip "break_row_extra" 4
.IX Item "break_row_extra"
.PP
Extra \s-1HTML\s0 attributes for the table row in the standard break_row
template. You might pass a valign, align, class, or other attribute:
.PP
.Vb 1
\& break-row-extra=|class="myclass"|
.Ve
.Ip "break_template" 4
.IX Item "break_template"
.PP
The \s-1HTML\s0 template that is used to present a break row. Default is:
.PP
.Vb 3
\&
{break_row_extra>
\&
{break_cell_extra>
\&
.Ve
.Ip "cancel_button_style" 4
.IX Item "cancel_button_style"
.PP
The \s-1HTML\s0 style for the cancel button.
.Ip "cancel_text" 4
.IX Item "cancel_text"
.PP
The text placed in the \*(L"Cancel\*(R" button in both editor and wizard mode.
Default is \*(L"Cancel\*(R".
.Ip "cell_span" 4
.IX Item "cell_span"
.PP
The number of cells that are in the span of a normal widget-label
pair. The default is two, which is appropriate for the label in one
table cell and the widget in the other. If you have a row_template
like:
.PP
.Vb 1
\&
{LABEL}
-->
{WIDGET}
.Ve
you would want a cell_span of three. For the row_template
.PP
.Vb 4
\&
\& {LABEL}
\& {WIDGET}
\&
.Ve
you would want a cell_span of 1.
.PP
This allows the formatter to build the right number of cells for
spacers and whole_row templates.
.Ip "cgi" 4
.IX Item "cgi"
.PP
Signifies that some options may come from the \s-1URL\s0 calling the page
where the [table-editor] resides.
.PP
This allows a simple:
.PP
.Vb 1
\& [table-editor cgi=1][/table-editor]
.Ve
to be active for any table and key that are called with a \s-1URL\s0 like:
.PP
.Vb 1
\& http://your.catalog.url/cat/admin/flex_editor?mv_data_table=products?item_id=1
.Ve
The auto-secure option is turned off if this option is set, for it
would then be possible for people to call a table and set their own
security.
.Ip "check" 4
.IX Item "check"
.PP
A hash option that is active for every field. Defines a profile check
that should be run on the field before the record will be allowed to
be set (or the wizard allowed to go to the \fBNext\fR option.
.PP
This call
.PP
.Vb 5
\& [table-editor
\& table=products
\& item_id="[cgi sku]"
\& check.description=required
\& ][/table-editor]
.Ve
ensures that the description field will be non-blank and non-zero
before the record is written.
.PP
Works in conjunction with the process_filter profile provided as a
part of the \s-1UI\s0. If using the table editor outside the province of the
\&\s-1UI\s0, you will need to make sure you get this profile included; it
normally resides in lib/UI/profiles.
.Ip "clear_image" 4
.IX Item "clear_image"
.PP
In cases where the table-editor templates need a transparent image for
display padding, can set the path where that image is. Default is
bg.gif, which comes with the Interchange \s-1UI\s0.
.Ip "color_fail" 4
.IX Item "color_fail"
.PP
The color to set failure messages to in \s-1HTML\s0. Default Red.
.Ip "color_success" 4
.IX Item "color_success"
.PP
The color to set success messages to in \s-1HTML\s0. Default Green.
.Ip "data_cell_class" 4
.IX Item "data_cell_class"
.PD 0
.Ip "data_cell_style" 4
.IX Item "data_cell_style"
.Ip "data_cell_valign" 4
.IX Item "data_cell_valign"
.Ip "data_cell_width" 4
.IX Item "data_cell_width"
.Ip "data_cell_align" 4
.IX Item "data_cell_align"
.Ip "data_cell_extra" 4
.IX Item "data_cell_extra"
.PD
.PP
The settable parameters allowing change of the \s-1HTML\s0 appearance of the
data cell in the standard [table-editor] presentation. The default
is data_cell_class set to \fIcdata\fR.
.PP
The easiest thing to do to alter the look is define the \s-1CSS\s0 class for
\&\fIcdata\fR how you want it. But you can individually set the width,
style, and alignments; and you can attach scripting events or other
\&\s-1CSS\s0 calls to the cell as well with data_cell_extra.
.PP
The following table-editor call:
.PP
.Vb 8
\& [table-editor
\& table=products
\& item_id="[cgi sku]"
\& data_cell_class=newclass
\& data_cell_style="color:red"
\& data_cell_extra=|onMouseOver="alert('move that mouse!'"|
\& data_cell_valign=top
\& ][/table-editor]
.Ve
will result in a templated row of:
.PP
.Vb 7
\&
{LABEL}
\&
\& {WIDGET}{HELP?}{HELP} ... (rest of template)
\&
.Ve
.Ip "database" 4
.IX Item "database"
.PP
A hash attribute with a key associated with every field. Specifies the
database table that will be used for a lookup (if any).
.Ip "default" 4
.IX Item "default"
.PP
A hash attribute with a key associated with every field. Specifies the
default value that will be used in the field if none is found in the
table or otherwise available via the \fBdefault_ref\fR.
.PP
This is only active if the defaults flag is set.
.Ip "default_ref" 4
.IX Item "default_ref"
.PP
The hash reference that is used to set the defaults for the fields if
there is no data in the table for that row. Default is \f(CW$Values\fR, the
Interchange values hash.
.PP
You can set this in options with:
.PP
.Vb 1
\& [table-editor default_ref=`$CGI`]
.Ve
Note the backticks. This calls Perl, which returns the \f(CW$CGI\fR reference.
.PP
If you have previously collected some defaults in a scratch variable,
you could use that with:
.PP
.Vb 1
\& [table-editor default_ref=`$Scratch->{myhash}`]
.Ve
Not settable in metadata, and it *must* be a hash reference or there
will be a fatal error.
.PP
This is only active if the defaults flag is set.
.Ip "defaults" 4
.IX Item "defaults"
.PP
Allows defaults to be set from the default hash above. When used in
combination with force_defaults=1 forces the passed defaults to
override any data previously residing in the table record.
.Ip "enctype" 4
.IX Item "enctype"
.PP
The encoding type for the form generated by [table-editor]. If the
file_upload option is set, it defaults to multipart/form-data,
otherwise uses the form default for the browser (which is normally
application/x-www-form-urlencoded).
.Ip "extra" 4
.IX Item "extra"
.PP
A hash attribute with a key associated with every field. Specifies
some extra \s-1HTML\s0 \fIparameter\fR\|(s) which will be attached to the widget for
the field, based on the behavior of Vend::Form.
.PP
Normally used to pass an onChange or other scripting event.
.Ip "field" 4
.IX Item "field"
.PP
A hash attribute with a key associated with every field. Specifies the
fields to be used as a value-label pair for a lookup (if there is
one). Works in conjunction with the lookup and database tags.
.PP
To build a list of products for selection by \s-1SKU\s0 in the foo widget,
without having to use the \s-1SKU\s0 as the label, you can do:
.PP
.Vb 6
\& [table-editor
\& foo.widget=select
\& foo.lookup=1
\& foo.database=products
\& foo.field="sku,description"
\& /]
.Ve
Essentiallly the same as:
.PP
.Vb 4
\& [table-editor
\& foo.widget=select
\& foo.lookup_query="select sku,description from products order by description"
\& /]
.Ve
.Ip "file_upload" 4
.IX Item "file_upload"
.PP
Specifies that file upload should be enabled by changing the form
encoding type. Forms using the imagehelper widget need this set.
.Ip "filter" 4
.IX Item "filter"
.PP
A hash attribute with a key associated with every field. Specifies a
filter that will be applied to the widget result data before it is put
in the database. To make sure that an integer value doesn't have
extraneous whitespace that could cause an error, do:
.PP
.Vb 5
\& [table-editor
\& foo.widget=text_5
\& foo.label="Seconds before we should become impatient and beep"
\& foo.filter=digits
\& /]
.Ve
Filters can be chained; they are the normal Interchange filters active
in many situations.
.PP
Works in conjunction with the process_filter profile provided as a
part of the \s-1UI\s0. If using the table editor outside the province of the
\&\s-1UI\s0, you will need to make sure you get this profile included; it
normally resides in lib/UI/profiles.
.Ip "force_defaults" 4
.IX Item "force_defaults"
.PP
Causes the entries in the \*(L"defaults\*(R" hash to be used to set the
initial value of fields, disabling the preference for data coming from
an existing record in the database.
.Ip "form_extra" 4
.IX Item "form_extra"
.PP
Extra information (usually scripting event calls) for the form. For
instance, if you are maintaining a series of event monitors in and
want to make sure the user knows that some changes will be lost, you
can set up a routine named \fIcheck_change()\fR in JavaScript. To check
the change and ask for a confirmation before submission, you can do:
.PP
.Vb 6
\&
.Ve
.Vb 6
\& [table-editor
\& foo.widget=text_50
\& foo.label="Important stuff"
\& foo.extra='onChange="is_changed(this)"
\& form_extra='onSubmit="return check_change()"'
\& /]
.Ve
You could also pass style information if that is ever appropriate. For
form name, action, and target,
.Ip "form_name" 4
.IX Item "form_name"
.PP
The name of the form. Do not include the NAME= portion, that is
provided. Results in outputted \s-1HTML\s0 of:
.PP
.Vb 1
\&