|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.click.control.AbstractControl
org.apache.click.control.Field
org.apache.click.extras.control.HiddenList
public class HiddenList
Provides a control for rendering a list of
Hidden Fields:
<input type='hidden'>.
HiddenField to render
<input type="hidden">, however HiddeField can not render multiple values
under the same name.
HiddenList supports multiple values under the same name by rendering
the values as multiple hidden fields.
HiddenList hiddenList = new HiddenList("customerId");
hiddenList.addValue("123");
hiddenList.addValue("678");
This HiddenList would generate following HTML:
<input type="hidden" name="customerId" id="form-customerId_1" value="123"/> <input type="hidden" name="customerId" id="form-customerId_2" value="678"/>
| Field Summary | |
|---|---|
protected List |
valueObject
The hidden values. |
| Fields inherited from class org.apache.click.control.Field |
|---|
disabled, error, focus, form, help, label, readonly, required, tabindex, title, validate, value |
| Fields inherited from class org.apache.click.control.AbstractControl |
|---|
actionListener, attributes, headElements, listener, listenerMethod, messages, name, parent, styles |
| Fields inherited from interface org.apache.click.Control |
|---|
CONTROL_MESSAGES |
| Constructor Summary | |
|---|---|
HiddenList()
Create a default HiddenList. |
|
HiddenList(String name)
Create a HiddenList with the given name. |
|
| Method Summary | |
|---|---|
void |
addValue(String value)
Add the given value to this HiddenList. |
void |
bindRequestValue()
This method binds the submitted request values to the HiddenList values. |
Object |
getValueObject()
Returns the list of added values as a java.util.List of Strings. |
List |
getValues()
This method delegates to getValueObject() to return the
hidden values as a java.util.List of Strings. |
boolean |
isHidden()
Returns true. |
void |
render(HtmlStringBuffer buffer)
Render the HTML representation of the HiddenField. |
void |
setValueObject(Object valueObject)
Set the list of hidden values. |
| Methods inherited from class org.apache.click.control.Field |
|---|
getError, getErrorLabel, getFocus, getFocusJavaScript, getForm, getHelp, getId, getLabel, getRequestValue, getTabIndex, getTextAlign, getTitle, getValidate, getValidationJavaScript, getValue, getWidth, isDisabled, isReadonly, isRequired, isValid, onInit, onProcess, setDisabled, setError, setErrorMessage, setErrorMessage, setErrorMessage, setErrorMessage, setFocus, setForm, setHelp, setLabel, setListener, setParent, setReadonly, setRequired, setTabIndex, setTextAlign, setTitle, setValidate, setValue, setWidth, validate |
| Methods inherited from class org.apache.click.control.AbstractControl |
|---|
addStyleClass, appendAttributes, dispatchActionEvent, getActionListener, getAttribute, getAttributes, getContext, getControlSizeEst, getHeadElements, getHtmlImports, getMessage, getMessage, getMessage, getMessages, getName, getPage, getParent, getStyle, getStyles, getTag, hasAttribute, hasAttributes, hasStyles, onDeploy, onDestroy, onRender, removeStyleClass, renderTagBegin, renderTagEnd, setActionListener, setAttribute, setId, setName, setStyle, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected List valueObject
| Constructor Detail |
|---|
public HiddenList(String name)
name - the name of the fieldpublic HiddenList()
| Method Detail |
|---|
public void setValueObject(Object valueObject)
setValueObject in class FieldvalueObject - a list of Stringspublic Object getValueObject()
getValueObject in class Fieldpublic List getValues()
getValueObject() to return the
hidden values as a java.util.List of Strings.
public void addValue(String value)
HiddenList.
value - the hidden value to addpublic void bindRequestValue()
bindRequestValue in class Fieldpublic boolean isHidden()
isHidden in class FieldField.isHidden()public void render(HtmlStringBuffer buffer)
render in interface Controlrender in class AbstractControlbuffer - the specified buffer to render the control's output toControl.render(org.apache.click.util.HtmlStringBuffer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||