org.loom.tags
Class AbstractFormInputTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by org.loom.tags.AbstractTag
          extended by org.loom.tags.AbstractDecoratedTag
              extended by org.loom.tags.AbstractHtmlTag
                  extended by org.loom.tags.AbstractFormFieldTag
                      extended by org.loom.tags.AbstractFormInputTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.DynamicAttributes, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag, FormInputTag, HtmlTag, LoomTag
Direct Known Subclasses:
AbstractOptionsTag, AbstractTextFieldTag, InputCheckboxTag, InputFileTag, InputImageTag

public abstract class AbstractFormInputTag
extends AbstractFormFieldTag
implements FormInputTag

Parent class for any form field associated to a form input parameter.

Docs about the HTML fields can be found here

Author:
icoloma

Nested Class Summary
static class AbstractFormInputTag.LabelPosition
           
 
Field Summary
 
Fields inherited from class org.loom.tags.AbstractDecoratedTag
decorator
 
Fields inherited from class org.loom.tags.AbstractTag
out, repository, request, response
 
Constructor Summary
AbstractFormInputTag()
           
 
Method Summary
 java.lang.String getLabelCssClass()
          As of #LOOM-95, modified to propagate all the applied CSS classes to the surrounding label
 AbstractFormInputTag.LabelPosition getLabelPosition()
           
protected  java.lang.Boolean getRenderAsText()
           
protected  java.lang.Boolean getRenderLabel()
           
 java.lang.String getTranslatedLabel()
           
protected  java.util.Set<PropertyValidator> getValidators()
          Lazily initializes the list of Validators asociated to this field.
 java.lang.String getValue()
          Calculates this tag value.
protected  java.lang.Object getValueAsObject()
           
 boolean hasError()
           
protected  void initTag()
          Initializes the tag attributes
 boolean isEscapeRenderAsText()
           
 boolean isTranslateLabel()
           
protected  void printParentAttributes()
          Prints this instance attributes
 java.lang.String renderAsText()
          Gets this item value as String, to show when renderAsText is true By default, it returns the tag value
 void setAddTranslatedName(boolean addTranslatedName)
           
 void setEscapeRenderAsText(boolean escapeRenderAsText)
           
 void setLabelPos(java.lang.String labelPosition)
           
protected  void setLabelPosition(AbstractFormInputTag.LabelPosition position)
           
 void setRenderAsText(java.lang.Boolean renderAsText)
           
 void setRenderErrorDisplayComponent(java.lang.Boolean renderError)
           
 void setRenderLabel(java.lang.Boolean renderLabel)
           
 void setTranslateLabel(boolean translateLabel)
           
 void setValue(java.lang.String value)
           
 boolean shouldRenderAsText()
           
 boolean shouldRenderError()
           
 boolean shouldRenderLabel()
           
 
Methods inherited from class org.loom.tags.AbstractFormFieldTag
getForm, getLabel, isDisabled, setAccept, setAlign, setAlt, setDisabled, setForm, setLabel, setTabIndex, setType
 
Methods inherited from class org.loom.tags.AbstractHtmlTag
addCssClass, getAccesskey, getCssBuilder, getCssClass, getDir, getId, getLang, getName, getNormalizedName, getStyle, getTabindex, getTitle, getTranslatedTitle, identify, isCssProcessed, isTranslateTitle, setAccesskey, setCssClass, setCssProcessed, setDir, setId, setLang, setName, setStyle, setTabindex, 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, doTagImpl, endTag, evaluateExpression, getActionProperty, getAncestorWithClass, getBufferedBody, getExtendedAttributes, getMessagesRepository, getPageContext, getRequest, getResponse, getScopedAttribute, getWriter, removeScopedAttribute, setDynamicAttribute, setExtendedAttribute, setRequest, setResponse, setScopedAttribute, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, 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
 

Constructor Detail

AbstractFormInputTag

public AbstractFormInputTag()
Method Detail

initTag

protected void initTag()
Description copied from class: AbstractTag
Initializes the tag attributes

Overrides:
initTag in class AbstractFormFieldTag

printParentAttributes

protected void printParentAttributes()
                              throws java.io.IOException,
                                     javax.servlet.jsp.JspException
Description copied from class: AbstractFormFieldTag
Prints this instance attributes

Overrides:
printParentAttributes in class AbstractFormFieldTag
Throws:
java.io.IOException
javax.servlet.jsp.JspException

getTranslatedLabel

public java.lang.String getTranslatedLabel()
Returns:
if translateLabel == false, the label as is. Else, the result of calling MessagesRepository.guessString(label)

getValue

public java.lang.String getValue()
Calculates this tag value. If this tag has an associated error message, return the request value prior to conversion. Else, extract the property value and convert to String.


renderAsText

public java.lang.String renderAsText()
Gets this item value as String, to show when renderAsText is true By default, it returns the tag value


getValueAsObject

protected java.lang.Object getValueAsObject()
Returns:
the value extracted from the nested property inside the action bean. Note that this method does not consider validation or conversion errors. Consider using getValue() instead.

hasError

public boolean hasError()
Returns:
true if this component has any validation error associated

getValidators

protected java.util.Set<PropertyValidator> getValidators()
Lazily initializes the list of Validators asociated to this field.

Returns:
The validator list, empty if none.

getLabelCssClass

public java.lang.String getLabelCssClass()
As of #LOOM-95, modified to propagate all the applied CSS classes to the surrounding label

Returns:
the css classes to apply to the surrounding label

setRenderLabel

public void setRenderLabel(java.lang.Boolean renderLabel)

setRenderErrorDisplayComponent

public void setRenderErrorDisplayComponent(java.lang.Boolean renderError)

shouldRenderLabel

public boolean shouldRenderLabel()
Returns:
true if the component or the form are set to renderLabel

shouldRenderAsText

public boolean shouldRenderAsText()
Returns:
true if the component or the form are set to renderAsText

shouldRenderError

public boolean shouldRenderError()
Returns:
true if the component or the form are set to renderError display component

setValue

public void setValue(java.lang.String value)

getLabelPosition

public AbstractFormInputTag.LabelPosition getLabelPosition()

setLabelPos

public void setLabelPos(java.lang.String labelPosition)

setLabelPosition

protected void setLabelPosition(AbstractFormInputTag.LabelPosition position)

setRenderAsText

public void setRenderAsText(java.lang.Boolean renderAsText)

isTranslateLabel

public boolean isTranslateLabel()

setTranslateLabel

public void setTranslateLabel(boolean translateLabel)

setAddTranslatedName

public void setAddTranslatedName(boolean addTranslatedName)

isEscapeRenderAsText

public boolean isEscapeRenderAsText()

setEscapeRenderAsText

public void setEscapeRenderAsText(boolean escapeRenderAsText)

getRenderLabel

protected java.lang.Boolean getRenderLabel()

getRenderAsText

protected java.lang.Boolean getRenderAsText()


The Loom Framework 1.6-SNAPSHOT.
Licensed under the Apache License, Version 2.0 by Extrema Sistemas de Informacion S.L.