Paloose Forms
The Paloose Forms (PForms) framework is loosely based on JXForms (now deprecated) which
in turn was based on XForms. There are sufficient
differences with PForms to make the latter to be of only loose help. It is worth reading
the FAQ entry on
flows for some background information on why Paloose Forms do not use
CForms.
The use of PForms is described elsewhere, this page just gives the PForm elements.
Basic Structure
A Paloose form is enclosed by the <form> in the
namespace "http://www.paloose.org/schemas/Forms/1.0":
<pf:form id="addUserForm" flow="addUser" continuation="{flow:continuation.id}" session="{flow:__flowId}">
<pf:label>Text associated with the form</pf:label>
...
</pf:form>
where:
- id — the identity of this form (used
mainly in the CSS,
- flow — the flow being
used,
- continuation — the continuation
identity used to navigate the flow,
- session — the current flow session
id.
For more explanation of these see the PForms
example. Within the form structure there are a set of items that reflect the
various components within a form.
Simple Input Field (Input).
Input fields contain a single line entry field (cf HTML <input> input field). It has the following example structure:
<pf:input ref="username" class="usernameField">
<pf:label>...</pf:label>
<pf:value>...</pf:value>
<pf:hint>...</pf:hint>
<pf:violations/>
</pf:input>
where the attributes are:
- ref — how the flowscript references
this field,
- class — the id for the CSS
style.
Simple Password Field (secret).
Secret fields are identical to input fields except that text entered only displays as
"*". They have identical structure to input fields:
<pf:secret ref="password" class="passwordField">
<pf:label>...</pf:label>
<pf:value>...</pf:value>
<pf:hint>...</pf:hint>
<pf:violations/>
</pf:secret>
where the attributes are:
- ref — how the flowscript references
this field,
- class — the id for the CSS
style.
Hidden Field (hidden).
Hidden fields allow the transmission of information that is hidden from the user. The
only enclosed data is the initial value:
<pf:hidden ref="password">
<pf:value>...</pf:value>
</pf:hidden>
where the attributes are:
- ref — how the flowscript references
this field,
Output Field (output).
Output fields allow display of data to the user in a read-only field for giving the user
information. For example the following would display the value of the flow variable username:
<pf:output ref="username">
<pf:label>Username:</pf:label>
<pf:value>{flow:username}</pf:value>
</pf:output>
where the attributes are:
- ref — how the flowscript references
this field,
Form button (submit).
Submit entries define how the form is treated, for example would produce an HTML form
button:
<pf:submit class="button" id="next">
<pf:label>Next</pf:label>
<pf:hint>Go to optional details entry</pf:hint>
</pf:submit>
where the attributes are:
- ref — how the flowscript references
this field,
- class — the id for the CSS
style.
Multiple Select Fields.
When it is required to select several of a set of choices the multiple select is used.
This is the equivalent of the checkbox HTML form field. Each choice is entered as a set of
fields
<pf:select appearance="full|compact" ref="roles">
<pf:value>...</pf:value>
<pf:choices>
<pf:item checked="false|true">
<pf:label>...</pf:label>
<pf:value>...</pf:value>
<pf:hint>...</pf:hint>
</pf:item>
<pf:item>
...
</pf:item>
</pf:choices>
</pf:select>
where the attributes are:
- ref — how the flowscript references
this field,
- appearance — the style of the multiple
selection. full denotes a set of checkboxes, and compact is a multiple selection list. If appearance is omitted then compact is
assumed.
- checked — whether the checkbox is
checked at page load time. If checked is omitted then
false is assumed.
For example:
<pf:select appearance="full" ref="roles">
<pf:value>editPage,manageUsers</pf:value>
<pf:choices>
<pf:item>
<pf:label>Edit Pages</pf:label>
<pf:value>editPage</pf:value>
<pf:hint>Can edit pages within the Web site</pf:hint>
</pf:item>
<pf:item>
<pf:label>Display Users</pf:label>
<pf:value>displayUsers</pf:value>
<pf:hint>Can display users</pf:hint>
</pf:item>
<pf:item>
<pf:label>Add/update/delete Users</pf:label>
<pf:value>manageUsers</pf:value>
<pf:hint>Can manage users: change password, delete/add users, change roles</pf:hint>
</pf:item>
</pf:choices>
</pf:select>
would display as:
while a compact version would display as:
Single Select Fields.
When it is required to select several of a set of choices the multiple select is used.
This is the equivalent of the checkbox HTML form field. Each choice is entered as a set of
fields
<pf:select1 appearance="full|compact" ref="...">
<pf:value>...</pf:value>
<pf:choices>
<pf:item>
<pf:label>...</pf:label>
<pf:value>...</pf:value>
<pf:hint>...</pf:hint>
</pf:item>
<pf:item>
...
</pf:item>
</pf:choices>
</pf:select>
where the attributes are:
- ref — how the flowscript references
this field,
- appearance — the style of the mutiple
selection. full denotes a set of checkboxes, and compact is a multiple selection list.
For example:
<pf:select appearance="full" ref="roles">
<pf:value>displayUsers</pf:value>
<pf:choices>
<pf:item>
<pf:label>Edit Pages</pf:label>
<pf:value>editPage</pf:value>
<pf:hint>Can edit pages within the Web site</pf:hint>
</pf:item>
<pf:item>
<pf:label>Display Users</pf:label>
<pf:value>displayUsers</pf:value>
<pf:hint>Can display users</pf:hint>
</pf:item>
<pf:item>
<pf:label>Add/update/delete Users</pf:label>
<pf:value>manageUsers</pf:value>
<pf:hint>Can manage users: change password, delete/add users, change roles</pf:hint>
</pf:item>
</pf:choices>
</pf:select>
would display as:
Text Area
text area fields allow multi-line
<pf:textarea ref="...">
<pf:label>...:</pf:label>
<pf:hint>...</pf:hint>
<pf:value>...</pf:value>
</pf:textarea>
where the attributes are:
- ref — how the flowscript references
this field,
For example:
<pf:textarea ref="comments" class="commentField">
<pf:value>{flow:comments}</pf:value>
<pf:hint>Any special comments outside of the above</pf:hint>
</pf:textarea>
Label Field
Label fields contain text that is associated with the field. For example:
<pf:input ref="username" class="usernameField">
<pf:label>User name</pf:label>
...
</pf:input>
which would typically output
Value Field
Value fields contain predefined data that is loaded into the field when the page is first
displayed. For example:
<pf:input ref="username" class="usernameField">
<pf:value>Please enter username</pf:value>
...
</pf:input>
would put the text "Please enter username" into the field when the page is loaded. If the
PXTemplateGen is used then it is possible to use sitemap variables, for example:
<pf:input ref="username" class="usernameField">
<pf:value>{flow:username}</pf:value>
...
</pf:input>
Hint Field
Hint field contains text that is output when the cursor is hovered above the field. For
example:
<pf:input ref="username" class="usernameField">
<pf:hint>The user's login username</pf:hint>
...
</pf:input>
Violations Field
Violations fields are empty place holders used when continuations require to report. Any
tags within here will be ignored. For example:
<pf:input ref="username" class="usernameField">
<pf:violations/>
...
</pf:input>
Copyright 2006 – 2023 Hugh Field-Richards. All Rights
Reserved.