Interface IAutoCompleteRenderer<T>
-
- Type Parameters:
T
-
- All Superinterfaces:
IClusterable
,IDetachable
,Serializable
- All Known Implementing Classes:
AbstractAutoCompleteRenderer
,AbstractAutoCompleteTextRenderer
,StringAutoCompleteRenderer
public interface IAutoCompleteRenderer<T> extends IDetachable
A renderer used to generate html output for theAutoCompleteBehavior
.Helper implementations of this interface may abstract the implementation specific details. Direct implementations of this interface should only be used when total control is required.
The autocompletion value is supplied via an attribute on the first html element named
textvalue
, if no attribute is found the innerHtml property of the first element will be used instead. For example:new IAutoCompleteRenderer() { void renderHead(Response r) { r.write(" <ul> "); } void render(Object o, Response r) { // notice the textvalue attribute we define for li element r.write(" <li textvalue=\""+o.toString()+"\"> <i>"+o.toString()+"</i> </li> "; } void renderFooter(Response r) { r.write(" </ul> "); } }
- Since:
- 1.2
- Author:
- Igor Vaynberg (ivaynberg), Janne Hietamäki (jannehietamaki)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
detach()
Override when needed.void
render(T object, Response response, String criteria)
Render the html fragment for the given completion object.void
renderFooter(Response response, int count)
Render the html footer fragment for the completion.void
renderHeader(Response response)
Render the html header fragment for the completion.
-
-
-
Method Detail
-
render
void render(T object, Response response, String criteria)
Render the html fragment for the given completion object. Usually the html is written out by callingResponse.write(CharSequence)
.- Parameters:
object
- completion choice objectresponse
- response objectcriteria
- text entered by user so far
-
renderHeader
void renderHeader(Response response)
Render the html header fragment for the completion. Usually the html is written out by callingResponse.write(CharSequence)
.- Parameters:
response
-
-
renderFooter
void renderFooter(Response response, int count)
Render the html footer fragment for the completion. Usually the html is written out by callingResponse.write(CharSequence)
.- Parameters:
response
-count
- The number of choices rendered
-
detach
default void detach()
Override when needed.- Specified by:
detach
in interfaceIDetachable
-
-