|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hivemind.impl.BaseLocatable
org.apache.tapestry.AbstractComponent
org.apache.tapestry.form.AbstractFormComponent
org.apache.tapestry.scriptaculous.Suggest
public abstract class Suggest
Implementation of the Ajax.Autocompleter in
the form of a TextField
like component with the additional ability to dynamically suggest
values via XHR requests.
This component will use the html element tag name defined in your html template to include it to determine whether or not to render a TextArea or TextField style input element. For example, specifying a component definition such as:
<input jwcid="@Suggest" value="literal:A default value" />
would render something looking like:
<input type="text" name="suggest" id="suggest" autocomplete="off" value="literal:A default value" />
while a defintion of
<textarea jwcid="@Suggest" value="literal:A default value" />
would render something like:
<textarea name="suggest" id="suggest" >A default value<textarea/>
Field Summary |
---|
Fields inherited from class org.apache.tapestry.AbstractComponent |
---|
_body, _bodyCount |
Constructor Summary | |
---|---|
Suggest()
|
Method Summary | |
---|---|
protected void |
finishLoad()
Sets the default ListItemRenderer for component, to be overriden as
necessary by component parameters. |
abstract IEngineService |
getEngineService()
Injected. |
abstract IActionListener |
getListener()
|
abstract ListenerInvoker |
getListenerInvoker()
Injected service used to invoke whatever listeners people have setup to handle changing value from this field. |
abstract ListItemRenderer |
getListItemRenderer()
|
abstract Object |
getListSource()
|
abstract int |
getMaxResults()
|
abstract String |
getOptions()
|
abstract Object |
getParameters()
|
abstract ResponseBuilder |
getResponse()
Injected response builder for doing specific XHR things. |
abstract IScript |
getScript()
Associated javascript template. |
abstract TranslatedFieldSupport |
getTranslatedFieldSupport()
Injected. |
List |
getUpdateComponents()
If set, will be used to update/refresh portions of a response during XHR requests. |
abstract String |
getUpdateElementClass()
|
abstract ValidatableFieldSupport |
getValidatableFieldSupport()
Injected. |
abstract Object |
getValue()
|
abstract ValueConverter |
getValueConverter()
Used to convert form input values. |
boolean |
isAsync()
Used to specify whether or not the result of this invocation should be returned asynchronously or use normal browser page reload semantics. |
boolean |
isJson()
Used to specify that the return invocation of the response created should be in the "http://json.org" format. |
boolean |
isRequired()
Returns false. |
abstract boolean |
isSearchTriggered()
Used internally to track listener invoked searches versus normal rendering requests. |
protected void |
renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle) to actually
render the component (with any parameter values already set). |
protected void |
renderFormComponent(IMarkupWriter writer,
IRequestCycle cycle)
Invoked from AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle)
to render the component. |
void |
renderList(IMarkupWriter writer,
IRequestCycle cycle)
Invoked only when a search has been triggered to render out the <li> list of dynamic suggestion options. |
protected void |
rewindFormComponent(IMarkupWriter writer,
IRequestCycle cycle)
Rewinds the component, doing translation, validation and binding. |
abstract void |
setListItemRenderer(ListItemRenderer renderer)
|
abstract void |
setListSource(Object value)
|
abstract void |
setSearchTriggered(boolean value)
|
abstract void |
setValue(Object value)
|
void |
trigger(IRequestCycle cycle)
Triggers the listener. |
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent |
---|
generateClientId, getCanTakeFocus, getForm, getIdParameter, getName, getRenderBodyOnRewind, peekClientId, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, setForm, setName, setName |
Methods inherited from class org.apache.hivemind.impl.BaseLocatable |
---|
getLocation, setLocation |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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 |
Methods inherited from interface org.apache.tapestry.IComponent |
---|
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName |
Methods inherited from interface org.apache.tapestry.IRender |
---|
render |
Methods inherited from interface org.apache.hivemind.LocationHolder |
---|
setLocation |
Methods inherited from interface org.apache.hivemind.Locatable |
---|
getLocation |
Methods inherited from interface org.apache.tapestry.IDirect |
---|
isStateful |
Constructor Detail |
---|
public Suggest()
Method Detail |
---|
public abstract ListenerInvoker getListenerInvoker()
public abstract ResponseBuilder getResponse()
public abstract IScript getScript()
public abstract ValueConverter getValueConverter()
public abstract ValidatableFieldSupport getValidatableFieldSupport()
public abstract TranslatedFieldSupport getTranslatedFieldSupport()
public abstract IEngineService getEngineService()
DirectService
engine.public abstract Object getValue()
public abstract void setValue(Object value)
public abstract ListItemRenderer getListItemRenderer()
public abstract void setListItemRenderer(ListItemRenderer renderer)
public abstract IActionListener getListener()
public abstract Object getListSource()
public abstract void setListSource(Object value)
public abstract int getMaxResults()
public abstract Object getParameters()
public abstract String getOptions()
public abstract String getUpdateElementClass()
public abstract boolean isSearchTriggered()
public abstract void setSearchTriggered(boolean value)
public boolean isRequired()
AbstractFormComponent
isRequired
in interface IFormComponent
isRequired
in class AbstractFormComponent
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
AbstractFormComponent
AbstractComponent.render(IMarkupWriter, IRequestCycle)
to actually
render the component (with any parameter values already set).
This implementation checks the rewinding state of the IForm
that contains the
component and forwards processing to either
AbstractFormComponent.renderFormComponent(IMarkupWriter, IRequestCycle)
or
AbstractFormComponent.rewindFormComponent(IMarkupWriter, IRequestCycle)
.
Those two are the methods that subclasses should implement.
renderComponent
in class AbstractFormComponent
AbstractComponent.renderComponent(org.apache.tapestry.IMarkupWriter,
org.apache.tapestry.IRequestCycle)
public void renderList(IMarkupWriter writer, IRequestCycle cycle)
writer
- The markup writer.cycle
- The associated request.protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)
AbstractFormComponent
AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle)
to render the component.
renderFormComponent
in class AbstractFormComponent
protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle)
rewindFormComponent
in class AbstractFormComponent
public void trigger(IRequestCycle cycle)
trigger
in interface IDirect
cycle
- The current request.public List getUpdateComponents()
IDynamicInvoker
For instance, if you have a page listing projects and you wanted to update an
Any
components contents whenever one of the project links was clicked
you would use a DirectLink
with the parameters:
updateComponents="{'projectDetails'}" async="true"
getUpdateComponents
in interface IDynamicInvoker
public boolean isAsync()
IDynamicInvoker
Async being true means responses will be encoded as XML using XmlHttpRequests. If you would like
your request/response to be in another format - like JSON - you must also specify the additional
parameter IDynamicInvoker.isJson()
. Without setting the IDynamicInvoker.getUpdateComponents()
parameter
this parameter is pretty useless.
isAsync
in interface IDynamicInvoker
IDynamicInvoker.isJson()
public boolean isJson()
IDynamicInvoker
IDynamicInvoker.getUpdateComponents()
parameter
this parameter is pretty useless.
isJson
in interface IDynamicInvoker
org.apache.tapestry.IJSONRender}
protected void finishLoad()
ListItemRenderer
for component, to be overriden as
necessary by component parameters.
finishLoad
in class AbstractComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |