Class Field
- java.lang.Object
-
- org.openidentityplatform.openam.click.control.AbstractControl
-
- org.openidentityplatform.openam.click.control.Field
-
- All Implemented Interfaces:
Serializable,org.apache.click.Stateful,org.openidentityplatform.openam.click.Control
- Direct Known Subclasses:
Button,FileField,HiddenField,Label,Radio,RadioGroup,TextArea,TextField
public abstract class Field extends AbstractControl implements org.apache.click.Stateful
Provides an abstract form Field control. Field controls are contained by theFormcontrol which will orchestrate the processing and rendering of the contained fields. All Form field controls must extend this abstract class.Field Processing
Post Requests
When processing POST requests forms typically invoke theonProcess()method on all its fields. The FieldonProcess()method is used to bind the fields request value, validate the submission and invoke any control listener method. If theonProcess()method returns true the form will continue processing fields, otherwise the form will abort further processing.The body of the Field
onProcess()method is detailed below.public boolean onProcess() { bindRequestValue(); if (getValidate()) { validate(); } registerActionEvent(); return true; }
The Field methods called byonProcess()include:bindRequestValue()- This method will bind the HTTP request value to the Field's value.
getValidate()- This method will return true if the Field should validate itself. This value is generally inherited from the parent Form, however the Field can override this value and specify whether it should be validated.
validate()- This method will validate the submitted Field value. If the submitted
value is not valid this method should set the Field
errorproperty, which can be rendered by the Form. AbstractControl.dispatchActionEvent()- This method will register any Control action listener method which has be defined for the Field.
validate()method, and possibly thebindRequestValue()method, to provide their own behaviour.Get Requests
When processing GET requests a Page's Form will typically perform no processing and simply render itself and its Fields.Rendering
Field subclasses must override theAbstractControl.render(org.openidentityplatform.openam.click.util.HtmlStringBuffer)method to enable themselves to be rendered as HTML. With the increasing use of AJAX, Fields should render themselves as valid XHTML, so that they may be parsed correctly and used as theinnerHtmlin the DOM.When a Form object renders a Field using autolayout, it renders the Field in a table row using the Field's
labelattribute, itserrorattribute if defined, and the FieldsAbstractControl.render(org.openidentityplatform.openam.click.util.HtmlStringBuffer)method.To assist with rendering valid HTML Field subclasses can use the
HtmlStringBufferclass.Message Resources and Internationalization (i18n)
Fields support a hierarchy of resource bundles for displaying validation error messages and display messages. These localized messages can be accessed through the methods:AbstractControl.getMessage(String)AbstractControl.getMessage(String, Object...)AbstractControl.getMessages()setErrorMessage(String)setErrorMessage(String, Object)
- Page scope messages
- Message lookups are first resolved to the Pages message bundle if it
exists. For example a
Loginpage may define the message properties:/com/mycorp/page/Login.properties
If you want messages to be used only for a specific Page, this is where to place them. - Global page scope messages
- Next message lookups are resolved to the global pages message bundle if it
exists.
/click-page.properties
If you want messages to be used across your entire application this is where to place them. - Control scope messages
- Next message lookups are resolved to the Control message bundle if it
exists. For example a
CustomTextFieldcontrol may define the message properties:/com/mycorp/control/CustomTextField.properties
- Global control scope messages
- Finally message lookups are resolved to the global application control
message bundle if the message has not already found. The global control
properties file is:
/click-control.properties
You can modify these properties by copying this file into your applications root class path and editing these properties.Note when customizing the message properties you must include all the properties, not just the ones you want to override.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandisabledThe Field disabled value.protected StringerrorThe Field error message.protected booleanfocusThe request focus flag.protected FormformThe parent Form.protected StringhelpThe Field help text.protected StringlabelThe Field label.protected StringlabelStyleThe field label "style" attribute value.protected StringlabelStyleClassThe field label "class" attribute value.protected StringparentStyleClassHintThe field's parent element "class" attribute hint.protected StringparentStyleHintThe field's parent element "style" attribute hint.protected booleanreadonlyThe Field is readonly flag.protected booleanrequiredThe Field is required flag.protected inttabindexThe Field 'tabindex' attribute.protected StringtitleThe Field 'title' attribute, which acts as a tooltip help message.protected booleantrimThe Field is trimmed flag, default value is true.protected BooleanvalidateThe validate Field valueonProcess()invocation flag.protected StringvalueThe Field value.-
Fields inherited from class org.openidentityplatform.openam.click.control.AbstractControl
actionListener, attributes, behaviors, headElements, listener, listenerMethod, messages, name, parent, styles
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindRequestValue()This method binds the submitted request value to the Field's value.StringgetError()Return the validation error message if the Field is not valid, or null if valid.protected StringgetErrorLabel()Return a normalized label for display in error messages.booleangetFocus()Return true if the field has requested focus.StringgetFocusJavaScript()Return the Field focus JavaScript.FormgetForm()Return the parent Form containing the Field or null if no form is present in the parent hierarchy.StringgetHelp()Return the field help text.StringgetId()Return the Form and Field id appended: "form-field"StringgetLabel()Return the field display label.StringgetLabelStyle()Return the field label "style" attribute value.StringgetLabelStyleClass()Return the field label "class" attribute value.StringgetParentStyleClassHint()Return the field's parent "class" attribute hint.StringgetParentStyleHint()Return the field's parent "style" attribute hint.protected StringgetRequestValue()Return the field's value from the request.ObjectgetState()Return the Field state.intgetTabIndex()Return the field "tabindex" attribute value.StringgetTextAlign()Return the field CSS "text-align" style, or null if not defined.StringgetTitle()Return the 'title' attribute, or null if not defined.booleangetValidate()Return true if the Field should validate itself when being processed.StringgetValidationJavaScript()Return the field JavaScript client side validation function.StringgetValue()Return the Field value.ObjectgetValueObject()Return the object representation of the Field value.StringgetWidth()Return the width CSS "width" style, or null if not defined.booleanisDisabled()Return true if the Field is disabled.booleanisHidden()Return true if the Field type is hidden (<input type="hidden"/>) or false otherwise.booleanisReadonly()Return true if the Field is a readonly.booleanisRequired()Return true if the Field's value is required.booleanisTrim()Return true if the Field request value should be trimmed, false otherwise.booleanisValid()Return true if the Field is valid after being processed, or false otherwise.booleanonProcess()This method processes the page request returning true to continue processing or false otherwise.voidremoveState(org.openidentityplatform.openam.click.Context context)Remove the Field state from the session for the given request context.protected voidrenderTagBegin(String tagName, HtmlStringBuffer buffer)voidrestoreState(org.openidentityplatform.openam.click.Context context)Restore the Field state from the session for the given request context.voidsaveState(org.openidentityplatform.openam.click.Context context)Save the Field state to the session for the given request context.voidsetDisabled(boolean disabled)Set the Field disabled flag.voidsetError(String error)Set the Field validation error message.protected voidsetErrorMessage(String key)Set the error with the a label formatted message specified by the given message bundle key.protected <T> voidsetErrorMessage(String key, T value)Set the error with the a label and value formatted message specified by the given message bundle key.voidsetFocus(boolean focus)Set the Field request focus flag.voidsetForm(Form form)Set the Field's the parentForm.voidsetHelp(String help)Set the Field help text.voidsetLabel(String label)Set the Field display caption.voidsetLabelStyle(String value)Set the field label "style" attribute value.voidsetLabelStyleClass(String value)Set the field label "class" attribute value.voidsetListener(Object listener, String method)The callback listener will only be called during processing if the Field value is valid.voidsetParent(Object parent)Set the parent of the Field.voidsetParentStyleClassHint(String styleClassHint)Set the field's parent "class" attribute hint.voidsetParentStyleHint(String styleHint)Set the field's parent "style" attribute hint.voidsetReadonly(boolean readonly)Set the Field readonly flag.voidsetRequired(boolean required)Set the Field required status.voidsetState(Object state)Set the Field state.voidsetTabIndex(int tabindex)Set the field "tabindex" attribute value.voidsetTextAlign(String align)Set the field CSS horizontal "text-align" style.voidsetTitle(String value)Set the 'title' attribute tooltip message.voidsetTrim(boolean trim)Set the trim flag to true if the Field request value should be trimmed, false otherwise.voidsetValidate(boolean validate)Set the validate Field value when being processed flag.voidsetValue(String value)Set the Field value.voidsetValueObject(Object object)Set the value of the field using the given object.voidsetWidth(String value)Set the the CSS "width" style attribute.voidvalidate()The validate method is invoked byonProcess()to validate the request submission.-
Methods inherited from class org.openidentityplatform.openam.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, render, renderTagEnd, setActionListener, setAttribute, setId, setName, setStyle, toString
-
-
-
-
Field Detail
-
disabled
protected boolean disabled
The Field disabled value.
-
error
protected String error
The Field error message.
-
focus
protected boolean focus
The request focus flag.
-
form
protected Form form
The parent Form.
-
help
protected String help
The Field help text.
-
label
protected String label
The Field label.
-
labelStyle
protected String labelStyle
The field label "style" attribute value.
-
labelStyleClass
protected String labelStyleClass
The field label "class" attribute value.
-
parentStyleHint
protected String parentStyleHint
The field's parent element "style" attribute hint.
-
parentStyleClassHint
protected String parentStyleClassHint
The field's parent element "class" attribute hint.
-
readonly
protected boolean readonly
The Field is readonly flag.
-
required
protected boolean required
The Field is required flag.
-
tabindex
protected int tabindex
The Field 'tabindex' attribute.
-
title
protected String title
The Field 'title' attribute, which acts as a tooltip help message.
-
trim
protected boolean trim
The Field is trimmed flag, default value is true.
-
validate
protected Boolean validate
The validate Field valueonProcess()invocation flag.
-
value
protected String value
The Field value.
-
-
Constructor Detail
-
Field
public Field()
Construct a new Field object.
-
Field
public Field(String name)
Construct the Field with the given name.- Parameters:
name- the name of the Field
-
-
Method Detail
-
setParent
public void setParent(Object parent)
Set the parent of the Field.- Specified by:
setParentin interfaceorg.openidentityplatform.openam.click.Control- Overrides:
setParentin classAbstractControl- Parameters:
parent- the parent of the Control- Throws:
IllegalStateException- ifAbstractControl.nameis not definedIllegalArgumentException- if the given parent instance is referencingthisobject:if (parent == this)- See Also:
Control.setParent(Object)
-
isDisabled
public boolean isDisabled()
Return true if the Field is disabled. The Field will also be disabled if the parent FieldSet or Form is disabled.- Returns:
- true if the Field is disabled
- See Also:
setDisabled(boolean)
-
setDisabled
public void setDisabled(boolean disabled)
Set the Field disabled flag. Disabled fields are not processed nor validated and their action event is not fired.Important Note: an HTML form POST does not submit disabled fields values. Similarly disabled Click fields do not get processed or validated. However, JavaScript is often used to
enablefields prior to submission. Click is smart enough to recognize when a field was enabled this way by checking if the field has an incoming request parameter. If a field is disabled but has an incoming request parameter, Click will"enable"the field and process it.Caveat: Unfortunately the above behavior does not apply to
CheckboxandRadiobuttons. An HTML form POST for adisabledcheckbox/radio is the same as for anuncheckedcheckbox/radio. In neither case is a value submitted to the server and Click cannot make the distinction whether the checkbox/radio is disabled or unchecked.- Parameters:
disabled- the Field disabled flag
-
getError
public String getError()
Return the validation error message if the Field is not valid, or null if valid.- Returns:
- the Field validation error message, or null if valid
-
setError
public void setError(String error)
Set the Field validation error message. If the error message is not null the Field is invalid, otherwise it is valid.- Parameters:
error- the validation error message
-
getFocus
public boolean getFocus()
Return true if the field has requested focus.- Returns:
- true if the field has requested focus
-
setFocus
public void setFocus(boolean focus)
Set the Field request focus flag.- Parameters:
focus- the request focus flag
-
getFocusJavaScript
public String getFocusJavaScript()
Return the Field focus JavaScript.- Returns:
- the Field focus JavaScript
-
getForm
public Form getForm()
Return the parent Form containing the Field or null if no form is present in the parent hierarchy.- Returns:
- the parent Form containing the Field
-
setForm
public void setForm(Form form)
Set the Field's the parentForm.- Parameters:
form- Field's parentForm
-
getHelp
public String getHelp()
Return the field help text.If the help value is null, this method will attempt to find a localized help message in the parent messages using the key:
If not found then the message will be looked up in thegetName() + ".help"/click-control.propertiesfile using the same key.For example given a
CustomerPagewith the properties fileCustomerPage.properties:name.label=Customer Name name.help=Full name or Business name
The page TextField code:public class CustomerPage extends Page { TextField nameField = new TextField("name"); .. }
Will render the TextField label and title properties as:<td><label>Customer Name</label></td> <td><input type="text" name="name"/> <span="Full name or Business name"/>/td>
How the help text is rendered is depends upon the Field subclass.- Returns:
- the help text of the Field
-
setHelp
public void setHelp(String help)
Set the Field help text.- Parameters:
help- the help text of the Field
-
isHidden
public boolean isHidden()
Return true if the Field type is hidden (<input type="hidden"/>) or false otherwise. By default this method returns false.- Returns:
- false
-
getId
public String getId()
Return the Form and Field id appended: "form-field"Use the field the "id" attribute value if defined, or the name otherwise.
- Specified by:
getIdin interfaceorg.openidentityplatform.openam.click.Control- Overrides:
getIdin classAbstractControl- Returns:
- HTML element identifier attribute "id" value
- See Also:
Control.getId()
-
getLabel
public String getLabel()
Return the field display label.If the label value is null, this method will attempt to find a localized label message in the parent messages using the key:
If not found then the message will be looked up in thegetName() + ".label"/click-control.propertiesfile using the same key. If a value is still not found, the Field name will be converted into a label using the method:ClickUtils.toLabel(String)For example given a
CustomerPagewith the properties fileCustomerPage.properties:name.label=Customer Name name.title=Full name or Business name
The page TextField code:public class CustomerPage extends Page { TextField nameField = new TextField("name"); .. }
Will render the TextField label and title properties as:<td><label>Customer Name</label></td> <td><input type="text" name="name" title="Full name or Business name"/></td>
When a label value is not set, or defined in any properties files, then its value will be created from the Fields name.For example given the TextField code:
TextField nameField = new TextField("faxNumber");
Will render the TextField label as:<td><label>Fax Number</label></td> <td><input type="text" name="faxNumber"/></td>
- Returns:
- the display label of the Field
-
setLabel
public void setLabel(String label)
Set the Field display caption.- Parameters:
label- the display label of the Field
-
getLabelStyle
public String getLabelStyle()
Return the field label "style" attribute value.- Returns:
- the field label "style" attribute value
- See Also:
setLabelStyle(java.lang.String)
-
setLabelStyle
public void setLabelStyle(String value)
Set the field label "style" attribute value.Please note: the label is rendered by the containing Form or container, not the field itself. It is up to the parent Form (or container) on how to apply the label style.
nameField.setLabelStyle("color: green; font-weight: bold");- Parameters:
value- the field label "style" attribute value
-
getLabelStyleClass
public String getLabelStyleClass()
Return the field label "class" attribute value.- Returns:
- the field label "class" attribute value
- See Also:
setLabelStyleClass(java.lang.String)
-
setLabelStyleClass
public void setLabelStyleClass(String value)
Set the field label "class" attribute value.Please note: the label is rendered by the containing Form or container, not the field itself. It is up to the parent Form (or container) on how to apply the label style class.
- Parameters:
value- the field label "class" attribute value
-
getParentStyleHint
public String getParentStyleHint()
Return the field's parent "style" attribute hint.- Returns:
- the field's parent "style" attribute hint
- See Also:
setParentStyleHint(java.lang.String)
-
setParentStyleHint
public void setParentStyleHint(String styleHint)
Set the field's parent "style" attribute hint.nameField.setParentStyleHint("margin-bottom; 10px");Please note:The field's parent style provides a hint to Forms (or other containers) what style to render, but it is up to the Form (or container) implementation how the style will be applied. For example, Form will render the parent style on the table cells containing the field and label.- Parameters:
styleHint- the field's parent "style" attribute hint
-
getParentStyleClassHint
public String getParentStyleClassHint()
Return the field's parent "class" attribute hint.- Returns:
- the field's parent "class" attribute hint
- See Also:
setParentStyleClassHint(java.lang.String)
-
setParentStyleClassHint
public void setParentStyleClassHint(String styleClassHint)
Set the field's parent "class" attribute hint.Please note:The parent style class provides a hint to Forms (or other containers) which CSS class to render, but it is up to the Form (or container) implementation how the style class will be applied. For example, Form will render the parent style class on the table cells containing the field and label.
- Parameters:
styleClassHint- the field parent "class" attribute hint
-
setListener
public void setListener(Object listener, String method)
The callback listener will only be called during processing if the Field value is valid. If the field has validation errors the listener will not be called.- Specified by:
setListenerin interfaceorg.openidentityplatform.openam.click.Control- Overrides:
setListenerin classAbstractControl- Parameters:
listener- the listener object with the named method to invokemethod- the name of the method to invoke- See Also:
Control.getName()
-
isReadonly
public boolean isReadonly()
Return true if the Field is a readonly. The Field will also be readonly if the parent FieldSet or Form is readonly.- Returns:
- true if the Field is a readonly
-
setReadonly
public void setReadonly(boolean readonly)
Set the Field readonly flag.- Parameters:
readonly- the Field readonly flag
-
isRequired
public boolean isRequired()
Return true if the Field's value is required.- Returns:
- true if the Field's value is required
-
setRequired
public void setRequired(boolean required)
Set the Field required status.- Parameters:
required- set the Field required status
-
getTabIndex
public int getTabIndex()
Return the field "tabindex" attribute value.- Returns:
- the field "tabindex" attribute value
-
setTabIndex
public void setTabIndex(int tabindex)
Set the field "tabindex" attribute value.- Parameters:
tabindex- the field "tabindex" attribute value
-
getTextAlign
public String getTextAlign()
Return the field CSS "text-align" style, or null if not defined.- Returns:
- the field CSS "text-align" style, or null if not defined.
-
setTextAlign
public void setTextAlign(String align)
Set the field CSS horizontal "text-align" style.- Parameters:
align- the CSS "text-align" value:["left", "right", "center"]
-
getTitle
public String getTitle()
Return the 'title' attribute, or null if not defined. The title attribute acts like tooltip message over the Field.If the title value is null, this method will attempt to find a localized title message in the parent messages using the key:
If not found then the message will be looked up in thegetName() + ".title"/click-control.propertiesfile using the same key. If still not found the title will be left as null and will not be rendered.For example given a
CustomerPagewith the properties fileCustomerPage.properties:name.label=Customer Name name.title=Full name or Business name
The page TextField code:public class CustomerPage extends Page { TextField nameField = new TextField("name"); .. }
Will render the TextField label and title properties as:<td><label>Customer Name</label></td> <td><input type="text" name="name" title="Full name or Business name"/></td>
- Returns:
- the 'title' attribute tooltip message
-
setTitle
public void setTitle(String value)
Set the 'title' attribute tooltip message.- Parameters:
value- the 'title' attribute tooltip message
-
isTrim
public boolean isTrim()
Return true if the Field request value should be trimmed, false otherwise. The default value is"true".- Returns:
- true if the Field request value should be trimmed, false otherwise
-
setTrim
public void setTrim(boolean trim)
Set the trim flag to true if the Field request value should be trimmed, false otherwise.- Parameters:
trim- true if the Field request value should be trimmed, false otherwise
-
getValidate
public boolean getValidate()
Return true if the Field should validate itself when being processed.If the validate attribute for the Field is not explicitly set, this method will return the validation status of its parent Form, see
Form.getValidate(). If the Field validate attribute is not set and the parent Form is not set this method will return true.This method is called by the
onProcess()method to determine whether the the Fieldvalidate()method should be invoked.- Returns:
- true if the Field should validate itself when being processed.
-
setValidate
public void setValidate(boolean validate)
Set the validate Field value when being processed flag.- Parameters:
validate- the field value when processed
-
getValidationJavaScript
public String getValidationJavaScript()
Return the field JavaScript client side validation function.The function name must follow the format
validate_[id], where the id is the DOM element id of the fields focusable HTML element, to ensure the function has a unique name.- Returns:
- the field JavaScript client side validation function
-
isValid
public boolean isValid()
Return true if the Field is valid after being processed, or false otherwise. If the Field has no error message afterControl.onProcess()has been invoked it is considered to be valid.- Returns:
- true if the Field is valid after being processed
-
getValue
public String getValue()
Return the Field value.- Returns:
- the Field value
-
setValue
public void setValue(String value)
Set the Field value.- Parameters:
value- the Field value
-
getValueObject
public Object getValueObject()
Return the object representation of the Field value. This method will return a string value, or null if the string value is null or is zero length.Specialized object field subclasses should override this method to return a non string object. For examples a
DoubleFieldwould return aDoublevalue instead.- Returns:
- the object representation of the Field value
-
setValueObject
public void setValueObject(Object object)
Set the value of the field using the given object.- Parameters:
object- the object value to set
-
getWidth
public String getWidth()
Return the width CSS "width" style, or null if not defined.- Returns:
- the CSS "width" style attribute, or null if not defined
-
setWidth
public void setWidth(String value)
Set the the CSS "width" style attribute.- Parameters:
value- the CSS "width" style attribute
-
bindRequestValue
public void bindRequestValue()
This method binds the submitted request value to the Field's value.Please note: while it is possible to explicitly bind the field value by invoking this method directly, it is recommended to use the "
bind" utility methods inClickUtilsinstead. SeeClickUtils.bind(org.apache.click.control.Field)for more details.
-
getState
public Object getState()
Return the Field state. The following state is returned:- Specified by:
getStatein interfaceorg.apache.click.Stateful- Returns:
- the Field state
-
setState
public void setState(Object state)
Set the Field state.- Specified by:
setStatein interfaceorg.apache.click.Stateful- Parameters:
state- the Field state to set
-
onProcess
public boolean onProcess()
This method processes the page request returning true to continue processing or false otherwise. The FieldonProcess()method is typically invoked by the FormonProcess()method when processing POST request.This method will bind the Field request parameter value to the field, validate the submission and invoke its callback listener if defined.
Below is a typical onProcess implementation:
public boolean onProcess() { bindRequestValue(); if (getValidate()) { validate(); } registerActionEvent(); return true }
- Specified by:
onProcessin interfaceorg.openidentityplatform.openam.click.Control- Overrides:
onProcessin classAbstractControl- Returns:
- true to continue Page event processing or false otherwise
- See Also:
Control.onProcess()
-
removeState
public void removeState(org.openidentityplatform.openam.click.Context context)
Remove the Field state from the session for the given request context.- Parameters:
context- the request context- See Also:
saveState(Context),restoreState(Context)
-
restoreState
public void restoreState(org.openidentityplatform.openam.click.Context context)
Restore the Field state from the session for the given request context.This method delegates to
setState(java.lang.Object)to set the field restored state.- Parameters:
context- the request context- See Also:
saveState(Context),removeState(Context)
-
saveState
public void saveState(org.openidentityplatform.openam.click.Context context)
Save the Field state to the session for the given request context.* This method delegates to
getState()to retrieve the field state to save.- Parameters:
context- the request context- See Also:
restoreState(Context),removeState(Context)
-
validate
public void validate()
The validate method is invoked byonProcess()to validate the request submission. Field subclasses should override this method to implement request validation logic.If the field determines that the submission is invalid it should set the
errorproperty with the error message.
-
getErrorLabel
protected String getErrorLabel()
Return a normalized label for display in error messages.The error label is a normalized version of
getLabel().- Returns:
- a normalized label for error message display
-
setErrorMessage
protected void setErrorMessage(String key)
Set the error with the a label formatted message specified by the given message bundle key. The message will be formatted with the field label usinggetErrorLabel().setErrorMessage will attempt to find a localized error message as described here, using the following lookup strategy:
-
an error message is looked up for a specific Field instance by
prefixing the
keywith the Field's name:getMessage(getName() + "." + key); -
if no message is found for a specific Field instance, an error
message is looked up for the Field class based on the
key:getMessage(key);
- Parameters:
key- the key of the localized message bundle string
-
an error message is looked up for a specific Field instance by
prefixing the
-
setErrorMessage
protected <T> void setErrorMessage(String key, T value)
Set the error with the a label and value formatted message specified by the given message bundle key. The message will be formatted with the field label {0} usinggetErrorLabel()and the given value {1}.Also see
setErrorMessage(java.lang.String)on how to specify error messages for specific Field instances.- Parameters:
key- the key of the localized message bundle stringvalue- the value to format in the message
-
getRequestValue
protected String getRequestValue()
Return the field's value from the request.- Returns:
- the field's value from the request
-
renderTagBegin
protected void renderTagBegin(String tagName, HtmlStringBuffer buffer)
- Overrides:
renderTagBeginin classAbstractControl- Parameters:
tagName- the name of the tag to renderbuffer- the buffer to append the output to- See Also:
AbstractControl.renderTagBegin(java.lang.String, HtmlStringBuffer)
-
-