|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.controller.ControllerElement
com.jcorporate.expresso.core.controller.Input
An Input object is one of the three types of objects generated by a
Controller when it transitions from one state to another. The other two
are Actions and Outputs.
An Input is a request for information from the user. It may or may
not have a default value, a list of valid values, and other
attributes - any or all of which can be used by the user interface,
which can be a JSP, Servlet, application, or even an applet.
The following types are recognized by the expresso framework and automatically rendered: You may add your own types or ignore them if you are doing your own page rendering.
checkbox: Renders as a checkbox. If multivalued=true then will render the options as a list of checkboxes.
radio: If multivalued, will render all options as a list of radio buttons
checkbox-vertical: Only relevent for multivalues, renders the checkbox style as vertical
| Field Summary | |
static String |
ATTRIBUTE_CHECKBOX
The Input is intended to be rendered as a check box |
static String |
ATTRIBUTE_CHECKBOX_VERTICAL
The Input is intended to be rendered as a vertically aligned checkbox |
static String |
ATTRIBUTE_CSS_STYLE
Defines the CSS style to use when rendering the input. |
static String |
ATTRIBUTE_DROPDOWN
The Input is intended to be rendered as a drop down box |
static String |
ATTRIBUTE_FILE
The Input is indended to be a file upload box. |
static String |
ATTRIBUTE_HIDDEN
The Input is intended to be rendered as a Hidden Field |
static String |
ATTRIBUTE_LISTBOX
The Input is intended to be rendered as a List Box |
static String |
ATTRIBUTE_MULTIVALUED
Means that the Input will be some sort of multi-valued field and has valid values associated with it. |
static String |
ATTRIBUTE_ORIGINAL_VALUE
Attribute that contains the original value of this input. |
static String |
ATTRIBUTE_PASSWORD
Attribute for password boxes. |
static String |
ATTRIBUTE_RADIO
The Input is intended to be rendered as a Radio Button |
static String |
ATTRIBUTE_RADIO_VERTICAL
The Input is intended to be rendered as a Vertically Aligned Radio Button |
static String |
ATTRIBUTE_READONLY
The Input is intended to be read only. |
static String |
ATTRIBUTE_TEXTAREA
The Input is intended to be rendered as a Text Area |
static String |
ATTRIBUTE_TEXTLINE
text input, single line (as opposed to text area) |
static String |
ATTRIBUTE_TYPE
Attribute defines the HTML Type that will be used with the Input |
static String |
SELECTED
constant for JSTL attribute for 'selectness' of a given input |
| Constructor Summary | |
Input()
Default constructor |
|
Input(String newName)
Convenience constructor - to make a new Input object with a specific name |
|
Input(String newName,
String newLabel)
Constructor that sets the name and the label of the input |
|
| Method Summary | |
void |
addDefaultValue(String newValue)
supply another default value for this Input object; appropriate for multiple selection items |
void |
addValidValue(String value,
String descrip)
Add a valid value to the Input's dropdown |
Object |
clone()
Clones the input as per standard java.lang.Object specifications |
static ControllerElement |
fromXML(org.w3c.dom.Node n)
Return a controller element based upon the xml fragment [Factory Method] |
String |
getContent()
(Convenience for JSTL access, to be parallel with Output) Return a single default value supplied by the Controller for this Input object; returns the 0th item in list (we expect this function to be used only for single selection items) |
String |
getDefaultValue()
Return a single default value supplied by the Controller for this Input object; returns the 0th item in list (we expect this function to be used only for single selection items) |
ArrayList |
getDefaultValueList()
Return a list of default values supplied by the Controller for this Input object; appropriate for multiple selection items |
String |
getKey()
Retrieve the key for the input. |
String |
getLookup()
Returns the class name of a database object that can be used to look up valid values for this Input item, if there is one. |
int |
getMaxLength()
Return the maximum recommended length of the value for this Input object. |
String |
getMultiple()
Retrieve the multi select status. |
String |
getSelectedDisplay()
get the display string associated with the currently-selected (default). |
Vector |
getValidValues()
Return the list of Valid Values that are allowed for this Input item. |
void |
setDefaultValue(ControllerResponse response)
Convenience method to quickly set the default value from the form cache. |
void |
setDefaultValue(List list)
supply a list of default values for this Input object; appropriate for multiple selection items |
void |
setDefaultValue(String newValue)
supply a default value for this Input object; appropriate for single selection items; sets the 0th item in underlying list |
void |
setKey(String newKey)
The Key of the Input |
void |
setLookup(String s)
Set the name of the "lookup object" - the database object that the client can use to look up valid values for this Input item. |
void |
setMaxLength(int newMaxLength)
Set the maximum recommended length of the Input object |
void |
setMultiple(String newMultiple)
Set the the Input object allow multiple selections |
void |
setName(String newName)
Sets the inputs name. |
void |
setType(String newType)
Sets the input type |
void |
setValidValues(Vector v)
Method for the Controller to specify the valid values for this Input item |
FastStringBuffer |
toXML(FastStringBuffer stream)
Concert the object to an xml fragment. |
| Methods inherited from class com.jcorporate.expresso.core.controller.ControllerElement |
addNested, allNested, fromXML, getAttribute, getAttributes, getAttributesOrNull, getContent, getContents, getControllerResponse, getDescription, getDisplayLength, getLabel, getLines, getName, getNested, getNested, getNestedCount, getNestedIterator, getNestedMap, getNestedOrNull, getParent, getTitle, getType, remove, removeNested, setAttribute, setControllerResponse, setDescription, setDisplayLength, setLabel, setLines, setParent |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String SELECTED
public static final String ATTRIBUTE_LISTBOX
public static final String ATTRIBUTE_DROPDOWN
public static final String ATTRIBUTE_CHECKBOX
public static final String ATTRIBUTE_CHECKBOX_VERTICAL
public static final String ATTRIBUTE_RADIO
public static final String ATTRIBUTE_RADIO_VERTICAL
public static final String ATTRIBUTE_TEXTAREA
public static final String ATTRIBUTE_HIDDEN
public static final String ATTRIBUTE_READONLY
public static final String ATTRIBUTE_FILE
public static final String ATTRIBUTE_PASSWORD
public static final String ATTRIBUTE_ORIGINAL_VALUE
public static final String ATTRIBUTE_CSS_STYLE
public static final String ATTRIBUTE_MULTIVALUED
public static final String ATTRIBUTE_TEXTLINE
public static final String ATTRIBUTE_TYPE
| Constructor Detail |
public Input()
public Input(String newName)
newName - the new input name
public Input(String newName,
String newLabel)
newName - the name of the InputnewLabel - the label of the input| Method Detail |
public Object clone()
throws CloneNotSupportedException
clone in class ControllerElementCloneNotSupportedException - as per the API spec.public String getDefaultValue()
for multiple selectionspublic String getContent()
for multiple selectionspublic ArrayList getDefaultValueList()
for single selectionspublic String getLookup()
public int getMaxLength()
public FastStringBuffer toXML(FastStringBuffer stream)
toXML in class ControllerElementstream - A FastStringBuffer to append the data to.
public static ControllerElement fromXML(org.w3c.dom.Node n)
throws ControllerException
n - A DOM node to assemble this Input from.
ControllerException - if there was a parsing error. (ie malformed
nodes)
ControllerException - upon errorpublic Vector getValidValues()
public void setDefaultValue(String newValue)
newValue - The new default value for this Input itemfor multiple selectionpublic void setDefaultValue(List list)
list - The new list of default values (strings) for this Input itemfor adding multiple selection defaults one at a timepublic void addDefaultValue(String newValue)
newValue - The new default value for this Input itemfor single selection
public void setDefaultValue(ControllerResponse response)
throws ControllerException
response - The controller response where the form cache may exist
ControllerException - upon errorpublic void setLookup(String s)
s - the lookup class name to associate with the Inputpublic void setMaxLength(int newMaxLength)
newMaxLength - Specify the max length (in chars) for this
* input item's value.public void setName(String newName)
setName in class ControllerElementnewName - the new name for the Input
IllegalArgumentException - if the name is a 'reserved word' as
defined by ConfigManager.
public void addValidValue(String value,
String descrip)
value - the 'key' part of the valid valuedescrip - the description part of the valid value.public void setType(String newType)
setType in class ControllerElementnewType - the new type as appears in an Input tagpublic void setValidValues(Vector v)
v - The value/description pairs that make up the
* valid values for this Input object.public void setKey(String newKey)
newKey - the new valuepublic String getKey()
getKey in interface Cacheablepublic void setMultiple(String newMultiple)
newMultiple - Specify if true or false the input will accept multiple selects.public String getMultiple()
public String getSelectedDisplay()
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||