Module org.apache.wicket.extensions
Interface IAutoCompleteRenderer<T>
- Type Parameters:
T
-
- All Superinterfaces:
IClusterable
,IDetachable
,Serializable
- All Known Implementing Classes:
AbstractAutoCompleteRenderer
,AbstractAutoCompleteTextRenderer
,StringAutoCompleteRenderer
A renderer used to generate html output for the
AutoCompleteBehavior
.
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
Modifier and TypeMethodDescriptiondefault void
detach()
Override when needed.void
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 Details
-
render
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
Render the html header fragment for the completion. Usually the html is written out by callingResponse.write(CharSequence)
.- Parameters:
response
-
-
detach
Override when needed.- Specified by:
detach
in interfaceIDetachable
-