| The
output element is replaced with a simple representation
of the
submission value(s).
The implementation of this functionality is highly subjective, but provides a more aesthetic way of displaying a read-only version
of a form without having to resort to using
controls.
The representation is dependent on the
, and can be configured using the
static properties of the
ConfigDisplayValue ConfigDisplayValue nested class.
Unless specified otherwise below, the
output element is
replaced with a display value element having the
specified in the static
ConfigDisplayValue.ElementName ConfigDisplayValue.ElementName property
(div by default).
The attributes specified in the static
ConfigDisplayValue.AttributeNames ConfigDisplayValue.AttributeNames list
(id , class and style by default) are copied from
the
output element into the
display value element.
Details of the content of the display value element or other representation of the
control value are as follows:
-
FormControlType.TEXT TEXT ,
FormControlType.FILE FILE
- The content of the display value element is the
value of the
output element's
value attribute.
-
FormControlType.TEXTAREA TEXTAREA
- The content of the display value element is the content of the
TEXTAREA element
re-encoded
.
-
FormControlType.CHECKBOX CHECKBOX ,
FormControlType.RADIO RADIO
- The
output element is replaced with the
un-encoded content specified in the
ConfigDisplayValue.CheckedHTML ConfigDisplayValue.CheckedHTML or
ConfigDisplayValue.UncheckedHTML ConfigDisplayValue.UncheckedHTML static property, depending on
whether the
output element contains a
checked attribute.
If the relevant static property has a value of null (the default), the
output element is simply a
version of the form control.
Attempting to determine which labels might apply to which checkbox or radio button, allowing only the
selected controls to be displayed, would require a very complex and inexact algorithm, so is best left to the developer
to implement if required.
-
FormControlType.SELECT_SINGLE SELECT_SINGLE ,
FormControlType.SELECT_MULTIPLE SELECT_MULTIPLE
- The content of the display value element is the
label of the currently selected option.
In the case of a
FormControlType.SELECT_MULTIPLE SELECT_MULTIPLE control, all labels of selected options
are listed, separated by the text specified in the static
ConfigDisplayValue.MultipleValueSeparator ConfigDisplayValue.MultipleValueSeparator property
("
, " by default).
-
FormControlType.PASSWORD PASSWORD
- The content of the display value element is the
character specified in the
ConfigDisplayValue.PasswordChar ConfigDisplayValue.PasswordChar static property ('
* ' by default),
repeated n times, where n is the number of characters in the control's
submission value.
-
FormControlType.HIDDEN HIDDEN
- The output element is
completely.
-
FormControlType.BUTTON BUTTON ,
FormControlType.SUBMIT SUBMIT ,
FormControlType.IMAGE IMAGE
- The output element
is a
version of the original form control.
If the submission value of the control is null or an empty string,
the display value element is given the un-encoded content specified in the
ConfigDisplayValue.EmptyHTML ConfigDisplayValue.EmptyHTML static property.
|