org.loom.addons.autocompleter
Class AutocompleterTag

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.AbstractTextFieldTag
                              extended by org.loom.tags.core.InputTextTag
                                  extended by org.loom.addons.autocompleter.AutocompleterTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.DynamicAttributes, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag, NumberFieldTag, FormInputTag, HtmlTag, LoomTag, ParameterContainer

public class AutocompleterTag
extends InputTextTag
implements ParameterContainer

Prints an input field and a div for use with script.aculo.us Autocompleter. The tag can be used specifying an action and event (and possibly nested <l:param> tags), or a list of options:

 <a:autocompleter action="MyAction" event="myevent" name="mortgage.name">
    <l:param name="param1" value="value1">
 </a:autocompleter>
 

Author:
icoloma

Nested Class Summary
 
Nested classes/interfaces inherited from class org.loom.tags.AbstractFormInputTag
AbstractFormInputTag.LabelPosition
 
Field Summary
 
Fields inherited from class org.loom.tags.core.InputTextTag
DEFAULT_MAX_SIZE
 
Fields inherited from class org.loom.tags.core.AbstractTextFieldTag
maxlength, pattern, readonly
 
Fields inherited from class org.loom.tags.AbstractDecoratedTag
decorator
 
Fields inherited from class org.loom.tags.AbstractTag
out, repository, request, response
 
Constructor Summary
AutocompleterTag()
           
 
Method Summary
 AutocompleterTag addParameter(java.lang.String name, java.lang.Object value)
          Adds a parameter to the resulting url
 void doTagImpl()
          The method that must be implemented by the child class
protected  void printAutocompleterOptions(Converter converter)
          Prints the list of possible options
 void setAction(java.lang.String action)
          Set the target action of this autocompleter (alternative to url)
 void setEvent(java.lang.String event)
           
 void setOptions(java.util.List<?> options)
           
 void setUrl(java.lang.String url)
          Set the target URL of this autocompleter (alternative to action)
 
Methods inherited from class org.loom.tags.core.InputTextTag
getAutocomplete, getMax, getMin, renderAsText, setAutocomplete, setExcludeMax, setExcludeMin, setMax, setMax, setMin, setMin, setPrecision, setScale, setSize
 
Methods inherited from class org.loom.tags.core.AbstractTextFieldTag
getMaxlength, getPattern, printParentAttributes, setMaxlength, setMinlength, setPattern, setPattern, setReadonly
 
Methods inherited from class org.loom.tags.AbstractFormInputTag
getLabelCssClass, getLabelPosition, getRenderAsText, getRenderLabel, getTranslatedLabel, getValidators, getValue, getValueAsObject, hasError, initTag, isEscapeRenderAsText, isTranslateLabel, 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, 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

AutocompleterTag

public AutocompleterTag()
Method Detail

doTagImpl

public void doTagImpl()
               throws javax.servlet.jsp.JspException,
                      java.io.IOException
Description copied from class: AbstractTag
The method that must be implemented by the child class

Overrides:
doTagImpl in class InputTextTag
Throws:
javax.servlet.jsp.JspException
java.io.IOException

printAutocompleterOptions

protected void printAutocompleterOptions(Converter converter)
                                  throws java.io.IOException
Prints the list of possible options

Throws:
java.io.IOException

setUrl

public void setUrl(java.lang.String url)
Set the target URL of this autocompleter (alternative to action)


addParameter

public AutocompleterTag addParameter(java.lang.String name,
                                     java.lang.Object value)
Description copied from interface: ParameterContainer
Adds a parameter to the resulting url

Specified by:
addParameter in interface ParameterContainer
Parameters:
name - the name of the parameter
value - the value of the parameter
Returns:
the same instance of ParameterContainer, to allow nested calls.

setAction

public void setAction(java.lang.String action)
Set the target action of this autocompleter (alternative to url)


setEvent

public void setEvent(java.lang.String event)

setOptions

public void setOptions(java.util.List<?> options)


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