|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface I_CmsField
Defines the methods required for form fields.
| Method Summary | |
|---|---|
java.lang.String |
buildHtml(CmsFormHandler formHandler,
org.opencms.i18n.CmsMessages messages,
java.lang.String errorKey)
Builds the HTML input element for this element to be used in a frontend JSP. |
java.lang.String |
getErrorMessage()
Returns a optional, custom error message to be displayed instead of the standard validation error message. |
java.util.List |
getItems()
Returns the list of items for select boxes, radio buttons and checkboxes. |
java.lang.String |
getLabel()
Returns the description text of the input field. |
java.lang.String |
getName()
Returns the name of the input field. |
int |
getPlaceholder()
Returns the placeholder. |
int |
getPosition()
Returns the position. |
java.lang.String |
getType()
Returns the type of the input field, e.g. |
java.lang.String |
getValidationExpression()
Returns the regular expression that is used for validation of the field. |
java.lang.String |
getValue()
Returns the initial value of the field. |
boolean |
isMandatory()
Returns if this input field is mandatory. |
boolean |
needsItems()
Checks if an item list is needed for this field. |
void |
setPlaceholder(int placeholder)
Sets the placeholder. |
void |
setPosition(int position)
Sets the position. |
java.lang.String |
validate(CmsFormHandler formHandler)
Validates this field by validating it's constraints and input value. |
| Method Detail |
|---|
java.util.List getItems()
The list contains CmsFieldItem objects with the following information:
java.lang.String getLabel()
java.lang.String getName()
java.lang.String getType()
java.lang.String getValidationExpression()
java.lang.String getValue()
java.lang.String getErrorMessage()
boolean isMandatory()
boolean needsItems()
java.lang.String validate(CmsFormHandler formHandler)
formHandler - the handler of the current form
CmsFormHandler.ERROR_VALIDATION if validation of the input value failed, CmsFormHandler.ERROR_VALIDATION if validation of the input value failed
java.lang.String buildHtml(CmsFormHandler formHandler,
org.opencms.i18n.CmsMessages messages,
java.lang.String errorKey)
formHandler - the handler of the current formmessages - a resource bundle containing HTML snippets to build the HTML elementerrorKey - the key of the current error message
int getPlaceholder()
void setPlaceholder(int placeholder)
placeholder - the placeholder to setint getPosition()
void setPosition(int position)
position - the position to set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||