public class FormGroup extends BodyTagSupport
<appNG:formGroup>
can contain multiple <appNG:formElement>
s. The elements of a group are
implicitly enclosed with a <div>
container whose style
attribute can be set using the
styleClass
attribute of the taglet.
Attributes:true
if the field is mandatory<div>
and the element(s) with the given name when validation fails<span>
with the error message<div>
Favorite number:<br/> <appNG:formGroup name="select" styleClass="group" mandatory="true" mandatoryMessage="Please make your selection!" errorClass="error" errorElementId="numberError"> <select name="select"> <appNG:formElement> <option value="42">42</option> </appNG:formElement> <appNG:formElement> <option value="0815">0815</option> </appNG:formElement> <appNG:formElement> <option value="1701">1701</option> </appNG:formElement> </select> </appNG:formGroup> <div id="numberError"></div>Output (before submitting):
Favorite number:<br/> <div class="group"> <select name="select"> <option value="42">42</option> <option value="0815">0815</option> <option value="1701">1701</option> </select> <div id="numberError"></div> </div>Output (after submitting, nothing selected):
Favorite number:<br/> <div class="group error"> <select name="select" class="error"> <option value="42">42</option> <option value="0815">0815</option> <option value="1701">1701</option> </select> <div id="numberError"><span>Please make your selection!</span></div> </div>
FormElement
,
Form
,
Serialized FormbodyContent
id, pageContext
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
EVAL_BODY_AGAIN
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor and Description |
---|
FormGroup() |
Modifier and Type | Method and Description |
---|---|
int |
doAfterBody() |
int |
doStartTag() |
String |
getErrorClass() |
String |
getErrorElementId() |
String |
getErrorMessage() |
FormData |
getFormData() |
String |
getMandatoryMessage() |
String |
getName() |
String |
getStyleClass() |
protected FormGroup |
getWrappedFormGroup() |
boolean |
isMandatory() |
boolean |
isMultiple() |
void |
release() |
void |
setErrorClass(String errorClass) |
void |
setErrorElementId(String errorElementId) |
void |
setErrorMessage(String errorMessage) |
void |
setMandatory(boolean mandatory) |
void |
setMandatoryMessage(String mandatoryMessage) |
void |
setMultiple(boolean multiple) |
void |
setName(String name) |
void |
setStyleClass(String styleClass) |
doEndTag, doInitBody, getBodyContent, getPreviousOut, setBodyContent
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParent, setPageContext, setParent
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class BodyTagSupport
JspException
public int doAfterBody() throws JspException
doAfterBody
in interface IterationTag
doAfterBody
in class BodyTagSupport
JspException
public void release()
release
in interface Tag
release
in class BodyTagSupport
protected FormGroup getWrappedFormGroup()
public FormData getFormData()
public String getErrorClass()
public void setErrorClass(String errorClass)
public String getStyleClass()
public void setStyleClass(String styleClass)
public String getName()
public void setName(String name)
public boolean isMandatory()
public void setMandatory(boolean mandatory)
public boolean isMultiple()
public void setMultiple(boolean multiple)
public String getMandatoryMessage()
public void setMandatoryMessage(String mandatoryMessage)
public String getErrorElementId()
public void setErrorElementId(String errorElementId)
public String getErrorMessage()
public void setErrorMessage(String errorMessage)
Copyright © 2011–2017 aiticon GmbH. All rights reserved.