org.loom.tags.core
Class AbstractOptionsTag

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
                          extended by 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:

Author:
icoloma

Nested Class Summary
static class AbstractOptionsTag.SortBy
           
 
Nested classes/interfaces inherited from class org.loom.tags.AbstractFormInputTag
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
AbstractOptionsTag()
           
 
Method Summary
 void addOption(Option o)
           
 void calculateOptions()
          Returns the available options.
 java.util.List<Option> getNestedOptions()
           
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
 boolean isTranslateLabels()
           
 void pullOptionsFromAction()
          If the options value is a list of Option instances, adds them
 java.lang.String renderAsText()
          Returns the label of the currently selected option, translated if necessary
 void setKeyProperty(java.lang.String keyProperty)
           
 void setLabelProperty(java.lang.String labelProperty)
           
 void setOptions(java.lang.Iterable<?> options)
           
 void setOptionsComparatorClass(java.lang.String comparatorClass)
           
 void setSortBy(java.lang.String sortBy)
           
 void setTranslateLabels(boolean translateLabels)
           
 
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.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

AbstractOptionsTag

public AbstractOptionsTag()
Method Detail

calculateOptions

public void calculateOptions()
                      throws javax.servlet.jsp.JspException,
                             java.io.IOException
Returns the available options. Supports any combination of:

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.