au.id.jericho.lib.html
Class FormControlOutputStyle

java.lang.Object
  extended byau.id.jericho.lib.html.FormControlOutputStyle

public final class FormControlOutputStyle
extends java.lang.Object

*************

See Also:
FormField, FormFields

Nested Class Summary
static class FormControlOutputStyle.DisplayValueConfig
          ************* must not be null
 
Field Summary
static FormControlOutputStyle DISPLAY_VALUE
          The FormControl is replaced with a simple representation of its current value.
static FormControlOutputStyle NORMAL
          Normal display of the FormControl.
static FormControlOutputStyle REMOVE
          Remove the FormControl from the output document.
 
Method Summary
 java.lang.String toString()
          Returns a string representation of this object useful for debugging purposes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NORMAL

public static final FormControlOutputStyle NORMAL
Normal display of the FormControl.

This is the default display style.


REMOVE

public static final FormControlOutputStyle REMOVE
Remove the FormControl from the output document.


DISPLAY_VALUE

public static final FormControlOutputStyle DISPLAY_VALUE
The FormControl is replaced with a simple representation of its current value.

The representation is dependent on the control type, and can be configured using the static properties of the DisplayValueConfig nested class.

Unless specified otherwise below, the control is replaced with an element (hereinafter refered to as the value element) having the tag name specified in the static DisplayValueConfig.TagName property (div by default). The attributes specified in the static DisplayValueConfig.AttributeNames list (id, class and style by default) are copied with their current values from the control into the value element.

Details of the content of the value element or other representation of the control value are as follows:

TEXT, FILE
The content of the value element is the re-encoded value of the control's value attribute.
TEXTAREA
The content of the value element is the content of the TEXTAREA element re-encoded with white space formatting.
CHECKBOX, RADIO
The control is replaced with the un-encoded content specified in the DisplayValueConfig.CheckedHTML or DisplayValueConfig.UncheckedHTML static property, depending on whether the control has a checked attribute. If the relevant static property has a value of null (the default), the control is simply disabled. 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.
SELECT_SINGLE, SELECT_MULTIPLE
The content of the value element is the re-encoded label of the currently selected option. In the case of a SELECT_MULTIPLE control, all labels of selected options are listed, separated by the text specified in the static DisplayValueConfig.MultipleValueSeparator property (", " by default).
PASSWORD
The content of the value element is the encoded character specified in the DisplayValueConfig.PasswordChar static property ('*' by default), repeated n times, where n is the number of characters in the control's value.
HIDDEN
The control is removed.
BUTTON, SUBMIT, IMAGE
The control is disabled.

If the current value of the control is null or an empty string, the value element is given the un-encoded content specified in the DisplayValueConfig.EmptyHTML static property.

Method Detail

toString

public java.lang.String toString()
Returns a string representation of this object useful for debugging purposes.

Returns:
a string representation of this object useful for debugging purposes.