|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 HiddenField 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<String> |
valueObject
The hidden values. |
Fields inherited from class org.apache.click.control.Field |
---|
disabled, error, focus, form, help, label, labelStyle, labelStyleClass, parentStyleClassHint, parentStyleHint, readonly, required, tabindex, title, trim, validate, value |
Fields inherited from class org.apache.click.control.AbstractControl |
---|
actionListener, attributes, behaviors, 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<String> |
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, getLabelStyle, getLabelStyleClass, getParentStyleClassHint, getParentStyleHint, getRequestValue, getState, getTabIndex, getTextAlign, getTitle, getValidate, getValidationJavaScript, getValue, getWidth, isDisabled, isReadonly, isRequired, isTrim, isValid, onProcess, removeState, renderTagBegin, restoreState, saveState, setDisabled, setError, setErrorMessage, setErrorMessage, setFocus, setForm, setHelp, setLabel, setLabelStyle, setLabelStyleClass, setListener, setParent, setParentStyleClassHint, setParentStyleHint, setReadonly, setRequired, setState, setTabIndex, setTextAlign, setTitle, setTrim, setValidate, setValue, setWidth, validate |
Methods inherited from class org.apache.click.control.AbstractControl |
---|
addBehavior, addStyleClass, appendAttributes, dispatchActionEvent, getActionListener, getAttribute, getAttributes, getBehaviors, getContext, getControlSizeEst, getHeadElements, getHtmlImports, getMessage, getMessage, getMessages, getName, getPage, getParent, getStyle, getStyles, getTag, hasAttribute, hasAttributes, hasBehaviors, hasStyles, isAjaxTarget, onDeploy, onDestroy, onInit, onRender, removeBehavior, removeStyleClass, 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<String> valueObject
Constructor Detail |
---|
public HiddenList(String name)
name
- the name of the fieldpublic HiddenList()
Method Detail |
---|
public void setValueObject(Object valueObject)
setValueObject
in class Field
valueObject
- a list of Stringspublic Object getValueObject()
getValueObject
in class Field
public List<String> 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()
ClickUtils
instead. See ClickUtils.bind(org.apache.click.control.Field)
for more details.
bindRequestValue
in class Field
public boolean isHidden()
isHidden
in class Field
Field.isHidden()
public void render(HtmlStringBuffer buffer)
render
in interface Control
render
in class AbstractControl
buffer
- 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 |