Additional formfield types for DataForms
This plugin implements a set of additional special purpose formfields to be used in DataForm
To make use of these formfields use their type identifier in the
column of a DataForm definition, such as in
When defining a formfield additional parameters may be used in the
column to further customize the behavior of the element.
Known Formfield types
A formfield that is filled automatically based on values from one or more other formfields of the same topic. During an edit-save loop, values of fields listed in the
are extracted and concatenated using the specified
. Values of an
formfield cannot be edited by the user.
Either use this approach:
format: specify a format string to build up the autofill formfield; use
$<field-name> to reference a formfield (see example below)
... or do it the old way by looping over formfields:
header: add an optional string prefixed to the field value, but only when the source fields are not empty
fields: comma-separated list of one or more formfields to fetch values from
separator: separator used when concatenating all values into a new value for the
footer: append an optional string to the field value, but only when the source fields are not empty
A typical use-case for an
field is the construction of a TopicTitle based on other form properties:
|| header="Project" fields="Customer, ID, Year"
|| format="Project-$ID ($Customer, $Year)"
This is an alternative for the core
formfield type using the jQuery-ui datepicker widget
instead of using the Mishoo JSCalendar widget
It will launch a calendar when clicking into a
formfield to select a date from, as well as restricts allowed keys to be entered into the formfield. The format of a
will always be of a
pattern and thus not be depending on any locale settings. This is quite important to get consistant data rather than differences based on the user's current browser language.
While the value
stored into a
formfield is locale-independent will it display according to the settings of
A select box to chose an icon supported by Foswiki (famfamfam and fontawesome).
cat: list of icon categories to be included in the selection
include: regular expression of icons to include in the selection
exclude: regular expression of icons to be excluded from the selection
An icon category can be either a topic on the icon search path as defined in
famfamfam ... to select famfamfam icons only
silkicons ... to selec from a silk icon only,
flagicons ... to select a flag
Or an icon category as defined in the fontawesome definition:
- Brand Icons
- Chart Icons
- Currency Icons
- Directional Icons
- File Type Icons
- Form Control Icons
- Medical Icons
- Payment Icons
- Spinner Icons
- Text Editor Icons
- Video Player Icons
- Web Application Icons
Extract the numeric identifier from the topic name. This is most usefull for topics created using the
feature (see TemplateTopics
feature adds a numeric unique identifier when the topic is created. This identifier can be extracted using an
and stored into a DataForm and be available for formatted searches.
The value in the
column will be used to add leading zeros to the id. For example, given a topic FooBar1 has a DataForm
Then upon save the
formfield will have a value of
A general purpose IPv4 address, consisting of 4 octets, e.g.
A general purpose IPv6 address,e.g.
A hardware address given in 6 hex values, e.g.
This renders a textarea using the NatEditPlugin
. The size of the imput fields is specified similar to the standard
formfield type. Any additional parameters specific to
may be specified in the "Values" column.
A special IP address used for routing, consisting of 4 octets, e.g.
A standard telephone number. This formfield uses JQueryValidate
to make sure the formfield value is a valid phone number.
A drop-in replacement for the standard
formfield. See JQSelect2Contrib
A somewhat "smarter" checkbox formfield type. It allows to select one of the values as a placeholder representing "any" value in the selection.
So given this DataForm definition ...
... then selecting "Accross all Business Areas" will select all other areas with it. Likewise, selecting all
business areas indivudually will automatically select "Accross all Business Areas" as well.
Note that the "any value" selection is the one indicated by the "*" asterisk, or if not present the first in the list.
A time formfield using the clockpicker widget from http://weareoutman.github.io/clockpicker/
A topic reference using JQSelect2Contrib
web: the web the user can choose topics from; defaults to current web
default: the default value to use if no value exists yet
url: url for autocompletion, default:
TopicType: name of a TopicType to be selected
Custom parameters may be added. These will be appended to the autocompletion url.
There are a couple of parameters that further customize the behavior of the select2 widget. Some of the most useful ones are:
minimumInputLength: number of characters that have to be entered before the autocompletion url is called to fetch matching selections from the backend; default 0
quietMillis: number of milliseconds to wait for input before the backend is called for autocompletion
limit: maximum number of values fetched from the autocompletion backend, default 10
These are also available for the
A user reference using JQSelect2Contrib
url: url for autocompletion, default:
form: DataForm supposed to be attached to user profile pages; this form is used to search for users, default: UserForm
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions
for more help.
| 16 Jan 2017:
|| replace MoreFormfieldsAjaxHelper with a template solution to be able to override it when required; fixes in
autofill formfields; defaulting to YYYY/MM/DD in
date2 formfield now to prevent browsers from interpreting date formfields using their own idea of locales; added an
afterSaveHandler for formfield classes; add register of latest fontawesome icons for the
| 29 Jun 2016:
|| replaced MoreformfieldAjaxHelper topic with a template approach for higher flexibility
| 31 May 2016:
|| added formfield types
natedit; removed dependency on YAML; added a
format parameter to the
autofill formfield type; added
beforeSaveHandlers to network address formfield types to normalize their store format on save
| 01 Mar 2016:
|| fixed select2 in jquery-ui modal not allowing focus
| 09 Jan 2016:
|| added ipv6, fixed validation of all network addresses by properly integrating it into jquery.validate
| 09 Apr 2015:
|| documentation; final bugfixing before release; updated to latest clockpicker
| 26 Mar 2015:
|| updated list of all fontawesom icons; fixed rendering of Topic formfields values
| 16 Dec 2014:
|| fixed thumbnails in user autocompletion; don't inherit from ListFieldDefinition for performance reasons
| 22 Aug 2014:
|| added smarbox formfield
| 04 Apr 2014:
|| fixed compatibility with foswiki >= 1.2.0
| 23 Sep 2010:
|| initial release