|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.servlet.jsp.tagext.SimpleTagSupport
org.loom.tags.AbstractTag
org.loom.tags.AbstractDecoratedTag
org.loom.tags.AbstractHtmlTag
org.loom.tags.core.FormTag
@Tag(dynamicAttributes=true,
bodyContent=SCRIPTLESS,
example="<l:form action=\"Mortgages\" event=\"save\">\n <l:inputHidden name=\"mortgage.id\"/>\n <l:inputText name=\"mortgage.name\"/>\n <l:inputCheckbox name=\"mortgage.starred\"/>\n <l:inputSelect name=\"mortgage.country\" options=\"${action.countries}\" />\n <l:inputFile name=\"mortgage.photo\"/>\n</l:form>")
public class FormTagHTML form tag. This tag includes a target action and event that are not only used to generate the target URL but also dictates the validations that will be applied to the input fields.
| Field Summary | |
|---|---|
static boolean |
DEFAULT_RENDER_LABEL
should the form fields render a label by default, default true |
static boolean |
DEFAULT_SEPARATE_ERRORS
should the form fields render the error message as an HTML component by default, default false |
| Fields inherited from class org.loom.tags.AbstractDecoratedTag |
|---|
decorator |
| Fields inherited from class org.loom.tags.AbstractTag |
|---|
expressionLanguageProxy, loomServletRequestFactory, out, repository, request, response |
| Constructor Summary | |
|---|---|
FormTag()
|
|
| Method Summary | |
|---|---|
void |
addHiddenField(java.lang.String name,
java.lang.Object value)
Add a hidden field to this component. |
ParameterContainer |
addParameter(java.lang.String name,
java.lang.Object value)
Adds a parameter to the resulting url |
protected void |
calculateHiddenFields()
Calculate all the hidden fields to add to this form instance |
java.lang.String |
calculateMethodOverride()
When displaying the form tag, this method calculates the value of the OVERRIDE_METHOD parameter, for use with DELETE and PUT methods which are not supported by the browser. |
boolean |
doRenderLabel()
|
boolean |
doRenderSeparateErrors()
|
void |
doTagImpl()
The method that must be implemented by the child class |
protected void |
endTag()
Does the tag cleanup, if any. |
java.lang.String |
getMethod()
|
ActionMapping |
getTargetAction()
|
Event |
getTargetEvent()
|
UrlBuilder |
getUrl()
|
protected void |
initTag()
Initializes the tag attributes |
boolean |
isDisabled()
|
boolean |
isRenderAsText()
|
void |
setAccept(java.lang.String accept)
|
void |
setAcceptCharset(java.lang.String acceptCharset)
|
void |
setAction(java.lang.String action)
An Action instance or Class to get called when this form gets submitted. |
void |
setAutocomplete(java.lang.Boolean autocomplete)
|
void |
setDisabled(boolean disable)
|
void |
setEnctype(java.lang.String encType)
|
void |
setEvent(java.lang.String event)
The event that will be invoked when this form is submitted |
void |
setHash(java.lang.String hash)
The hash of the url (the fragment after '#') |
void |
setHostname(java.lang.String serverName)
The server name to use. |
void |
setMapping(java.lang.String mapping)
The mapping as action.event. |
void |
setMethod(java.lang.String method)
|
void |
setMultipart(boolean multipart)
Sets this form to submit multipart data. |
void |
setPort(java.lang.Integer port)
The port to use. |
void |
setRelative(boolean relative)
true if the url is relative (do not render schema, server or port), false to render a full URL. |
void |
setRenderAsText(boolean readOnly)
|
void |
setRenderLabel(java.lang.Boolean renderLabel)
|
void |
setRequest(LoomServletRequest request)
|
void |
setScheme(java.lang.String scheme)
The scheme to use. |
void |
setSeparateErrors(java.lang.Boolean renderError)
|
void |
setTarget(java.lang.String target)
|
| Methods inherited from class org.loom.tags.AbstractHtmlTag |
|---|
addCssClass, getAccesskey, getCssBuilder, getCssClass, getDir, getId, getLang, getName, getStyle, getTitle, getTranslatedTitle, identify, isCssProcessed, isIf, isTranslateTitle, printParentAttributes, renderTag, setAccesskey, setCssClass, setCssProcessed, setDir, setId, setIf, setLang, setName, setStyle, setTitle, setTranslateTitle |
| Methods inherited from class org.loom.tags.AbstractDecoratedTag |
|---|
doTag, getDecorator, getDecoratorInstance, setDecorator |
| Methods inherited from class org.loom.tags.AbstractTag |
|---|
createWriterWrapper, doBody, doBufferedBody, evaluateExpression, getActionProperty, getAncestorWithClass, getBufferedBody, getExtendedAttributes, getMessagesRepository, getPageContext, getRequest, getResponse, getScopedAttribute, getWriter, removeScopedAttribute, setDynamicAttribute, setExtendedAttribute, setJspContext, setResponse, setScopedAttribute, setWriter |
| Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport |
|---|
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.loom.tags.HtmlTag |
|---|
addCssClass, getCssBuilder |
| Methods inherited from interface org.loom.tags.LoomTag |
|---|
getExtendedAttributes, getRequest, getScopedAttribute, setExtendedAttribute, setScopedAttribute |
| Field Detail |
|---|
public static boolean DEFAULT_RENDER_LABEL
public static boolean DEFAULT_SEPARATE_ERRORS
| Constructor Detail |
|---|
public FormTag()
| Method Detail |
|---|
public void setRequest(LoomServletRequest request)
setRequest in class AbstractTagprotected void initTag()
AbstractTag
initTag in class AbstractTagprotected void endTag()
AbstractTag
endTag in class AbstractTag
public void doTagImpl()
throws javax.servlet.jsp.JspException,
java.io.IOException
AbstractTag
doTagImpl in class AbstractTagjavax.servlet.jsp.JspException
java.io.IOExceptionprotected void calculateHiddenFields()
public void addHiddenField(java.lang.String name,
java.lang.Object value)
addHiddenField in interface Formname - the name of the input elementvalue - the value, its toString form will be used. If null, the entire element will be omitted.public java.lang.String calculateMethodOverride()
java.lang.IllegalArgumentException - if a method has been specified that is not supported by the assigned eventpublic void setAccept(java.lang.String accept)
public void setAcceptCharset(java.lang.String acceptCharset)
public void setEnctype(java.lang.String encType)
public void setMethod(java.lang.String method)
public void setTarget(java.lang.String target)
@Attribute public void setAction(java.lang.String action)
action - the (unqualified or qualified) name of the action to use for this form@Attribute public void setEvent(java.lang.String event)
@Attribute public void setRelative(boolean relative)
@Attribute public void setScheme(java.lang.String scheme)
scheme - the scheme to use. Examples are: "http", "https"@Attribute public void setHostname(java.lang.String serverName)
@Attribute public void setPort(java.lang.Integer port)
port - the port to use. Examples are: 80, 443@Attribute public void setHash(java.lang.String hash)
@Attribute public void setMapping(java.lang.String mapping)
action.event. This method is equivalent to
setting action and event separately.
public ActionMapping getTargetAction()
public Event getTargetEvent()
public void setMultipart(boolean multipart)
multipart - boolean to set multipart, false if notpublic boolean doRenderLabel()
public boolean doRenderSeparateErrors()
public void setSeparateErrors(java.lang.Boolean renderError)
public void setRenderLabel(java.lang.Boolean renderLabel)
public boolean isDisabled()
public void setDisabled(boolean disable)
public boolean isRenderAsText()
public void setRenderAsText(boolean readOnly)
public void setAutocomplete(java.lang.Boolean autocomplete)
public java.lang.String getMethod()
public ParameterContainer addParameter(java.lang.String name,
java.lang.Object value)
ParameterContainer
addParameter in interface ParameterContainername - the name of the parametervalue - the value of the parameter
public UrlBuilder getUrl()
getUrl in interface Form
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||