org.loom.tags.core
Class AbstractOptionsTag
java.lang.Object
javax.servlet.jsp.tagext.SimpleTagSupport
org.loom.tags.AbstractTag
org.loom.tags.AbstractDecoratedTag
org.loom.tags.AbstractHtmlTag
org.loom.tags.AbstractFormFieldTag
org.loom.tags.AbstractFormInputTag
org.loom.tags.core.AbstractOptionsTag
- All Implemented Interfaces:
- javax.servlet.jsp.tagext.DynamicAttributes, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag, FormInputTag, HtmlTag, LoomTag
- Direct Known Subclasses:
- InputRadioTag, InputSelectTag
public abstract class AbstractOptionsTag
- extends AbstractFormInputTag
Select or Radio field with nested options.
There are three ways of specifying nested options:
- Enumeration properties get their options lists automatically filled (though it can be overriden)
- They can be specified using the options attribute, which must be an Iterable with either
Option instances or any other class in which case the labelProperty and keyProperty will be
used to convert to Option objects
- Options can be defined as nested l: option tags. This can be combined with any of the other two methods
- Author:
- icoloma
| Methods inherited from class org.loom.tags.AbstractFormInputTag |
getLabelCssClass, getLabelPosition, getRenderAsText, getRenderLabel, getTranslatedLabel, getValidators, getValue, getValueAsObject, hasError, initTag, isEscapeRenderAsText, isTranslateLabel, printParentAttributes, setAddTranslatedName, setEscapeRenderAsText, setLabelPos, setLabelPosition, setRenderAsText, setRenderErrorDisplayComponent, setRenderLabel, setTranslateLabel, setValue, shouldRenderAsText, shouldRenderError, 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.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 |
AbstractOptionsTag
public AbstractOptionsTag()
calculateOptions
public void calculateOptions()
throws javax.servlet.jsp.JspException,
java.io.IOException
- Returns the available options. Supports any combination of:
- An options attribute, pointing to an Enum class
- An options attribute, listing its values separated by commas
- Nested <option> tags, those will be used
- If the target action property is an enumeration, the possible values
will be used
- Throws:
javax.servlet.jsp.JspException
java.io.IOException
pullOptionsFromAction
public void pullOptionsFromAction()
- If the options value is a list of Option instances, adds them
guessOptionsFromEnumeration
protected void guessOptionsFromEnumeration(java.lang.Class<? extends java.lang.Enum<?>> enumerationClass)
- If the field is an Enum, translate the possible values to a list of
options
renderAsText
public java.lang.String renderAsText()
- Returns the label of the currently selected option, translated if
necessary
- Overrides:
renderAsText in class AbstractFormInputTag
addOption
public void addOption(Option o)
setTranslateLabels
public void setTranslateLabels(boolean translateLabels)
setOptions
public void setOptions(java.lang.Iterable<?> options)
getNestedOptions
public java.util.List<Option> getNestedOptions()
isTranslateLabels
public boolean isTranslateLabels()
setLabelProperty
public void setLabelProperty(java.lang.String labelProperty)
setKeyProperty
public void setKeyProperty(java.lang.String keyProperty)
setOptionsComparatorClass
public void setOptionsComparatorClass(java.lang.String comparatorClass)
setSortBy
public void setSortBy(java.lang.String sortBy)
The Loom Framework 1.6-SNAPSHOT.
Licensed under the Apache License, Version 2.0 by Extrema Sistemas de Informacion S.L.