net.sf.tacos.ajax.components
Class Autocompleter

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.form.AbstractFormComponent
              extended by net.sf.tacos.ajax.components.Autocompleter
All Implemented Interfaces:
Locatable, LocationHolder, org.apache.tapestry.form.IFormComponent, org.apache.tapestry.form.TranslatedField, org.apache.tapestry.form.ValidatableField, org.apache.tapestry.IComponent, org.apache.tapestry.IDirect, org.apache.tapestry.IRender

public abstract class Autocompleter
extends org.apache.tapestry.form.AbstractFormComponent
implements org.apache.tapestry.IDirect, org.apache.tapestry.form.TranslatedField

Autocompleteing component intended to be used in place of a TextField or a TextArea component to provide a searchable/selectable drop down list of choices for a form input text field.

Reference: Scriptaculous Ajax.Autocompleter

Author:
jkuhnert

Constructor Summary
Autocompleter()
           
 
Method Summary
abstract  String getAfterUpdateElement()
          After update element parameter
abstract  AjaxDirectService getAjaxEngine()
          Injected AjaxDirect engine
abstract  double getFrequency()
          Frequency parameter
abstract  org.apache.tapestry.IActionListener getListener()
          Required listener for performing search
abstract  org.apache.tapestry.listener.ListenerInvoker getListenerInvoker()
          Injected listener invoker
abstract  ListItemRenderer getListItemRenderer()
          List item renderer
abstract  Object getListSource()
          Required list item source parameter
abstract  int getMaxResults()
          Max number of results to show
abstract  String getOptions()
          Javascript options
abstract  Object getParameters()
          The parameters to add in the request
abstract  org.apache.tapestry.IScript getScript()
          Autocompleter script
abstract  String getTemplateTag()
          The tag used to add this component in the template
abstract  org.apache.tapestry.form.TranslatedFieldSupport getTranslatedFieldSupport()
          Injected.
abstract  org.apache.tapestry.form.ValidatableFieldSupport getValidatableFieldSupport()
          Injected.
abstract  Object getValue()
          value set
abstract  org.apache.tapestry.coerce.ValueConverter getValueConverter()
          Injected value converter
abstract  boolean isClientOnly()
          Client only usage
abstract  boolean isDirect()
          Use direct call
 boolean isRequired()
           
abstract  boolean isSearchTriggered()
          is triggered
protected  void renderComponent(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
           
protected  void renderFormComponent(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
          Renders the component.
protected  void renderList(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
          Invoked by renderComponent(IMarkupWriter, IRequestCycle) if the response from this request should be the returned value of whichever search was performed.
protected  void rewindFormComponent(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
          Rewinds the component, doing translation, validation and binding.
abstract  void setListSource(Object value)
          sets the list source
abstract  void setSearchTriggered(boolean value)
          sets triggered state
abstract  void setValue(Object value)
          sets value
 void trigger(org.apache.tapestry.IRequestCycle cycle)
          Triggers the listener.
 
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent
getAlwaysRenderBodyOnRewind, getCanTakeFocus, getForm, getIdParameter, getName, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, renderIdAttribute, setClientId, setForm, setName, setName
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.IDirect
isStateful
 
Methods inherited from interface org.apache.tapestry.form.TranslatedField
getTranslator
 
Methods inherited from interface org.apache.tapestry.form.ValidatableField
getValidators
 
Methods inherited from interface org.apache.tapestry.form.IFormComponent
getClientId, getDisplayName, getForm, getName, isDisabled, setName
 

Constructor Detail

Autocompleter

public Autocompleter()
Method Detail

getAjaxEngine

public abstract AjaxDirectService getAjaxEngine()
Injected AjaxDirect engine


getListenerInvoker

public abstract org.apache.tapestry.listener.ListenerInvoker getListenerInvoker()
Injected listener invoker


getScript

public abstract org.apache.tapestry.IScript getScript()
Autocompleter script


getValueConverter

public abstract org.apache.tapestry.coerce.ValueConverter getValueConverter()
Injected value converter


getListener

public abstract org.apache.tapestry.IActionListener getListener()
Required listener for performing search


getListSource

public abstract Object getListSource()
Required list item source parameter


setListSource

public abstract void setListSource(Object value)
sets the list source


getListItemRenderer

public abstract ListItemRenderer getListItemRenderer()
List item renderer


getMaxResults

public abstract int getMaxResults()
Max number of results to show


isDirect

public abstract boolean isDirect()
Use direct call


getFrequency

public abstract double getFrequency()
Frequency parameter


getAfterUpdateElement

public abstract String getAfterUpdateElement()
After update element parameter


getParameters

public abstract Object getParameters()
The parameters to add in the request


setSearchTriggered

public abstract void setSearchTriggered(boolean value)
sets triggered state


isSearchTriggered

public abstract boolean isSearchTriggered()
is triggered


getValue

public abstract Object getValue()
value set


setValue

public abstract void setValue(Object value)
sets value


getTemplateTag

public abstract String getTemplateTag()
The tag used to add this component in the template


getOptions

public abstract String getOptions()
Javascript options


isClientOnly

public abstract boolean isClientOnly()
Client only usage


getValidatableFieldSupport

public abstract org.apache.tapestry.form.ValidatableFieldSupport getValidatableFieldSupport()
Injected.


getTranslatedFieldSupport

public abstract org.apache.tapestry.form.TranslatedFieldSupport getTranslatedFieldSupport()
Injected.


isRequired

public boolean isRequired()
Specified by:
isRequired in interface org.apache.tapestry.form.IFormComponent
Overrides:
isRequired in class org.apache.tapestry.form.AbstractFormComponent
See Also:
AbstractFormComponent.isRequired()

renderComponent

protected void renderComponent(org.apache.tapestry.IMarkupWriter writer,
                               org.apache.tapestry.IRequestCycle cycle)
Overrides:
renderComponent in class org.apache.tapestry.form.AbstractFormComponent
See Also:
AbstractComponent.renderComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)

renderFormComponent

protected void renderFormComponent(org.apache.tapestry.IMarkupWriter writer,
                                   org.apache.tapestry.IRequestCycle cycle)
Renders the component.

Specified by:
renderFormComponent in class org.apache.tapestry.form.AbstractFormComponent

rewindFormComponent

protected void rewindFormComponent(org.apache.tapestry.IMarkupWriter writer,
                                   org.apache.tapestry.IRequestCycle cycle)
Rewinds the component, doing translation, validation and binding.

Specified by:
rewindFormComponent in class org.apache.tapestry.form.AbstractFormComponent

renderList

protected void renderList(org.apache.tapestry.IMarkupWriter writer,
                          org.apache.tapestry.IRequestCycle cycle)
Invoked by renderComponent(IMarkupWriter, IRequestCycle) if the response from this request should be the returned value of whichever search was performed.

Parameters:
writer -
cycle -

trigger

public void trigger(org.apache.tapestry.IRequestCycle cycle)
Triggers the listener. The parameters passed are the current text and those specified in the parameters parameter of the component.

Specified by:
trigger in interface org.apache.tapestry.IDirect