Interface IAutoCompleteRenderer<T>
- Type Parameters:
T-
- All Superinterfaces:
org.apache.wicket.util.io.IClusterable,org.apache.wicket.model.IDetachable,Serializable
- All Known Implementing Classes:
AbstractAutoCompleteRenderer,AbstractAutoCompleteTextRenderer,StringAutoCompleteRenderer
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 voiddetach()Override when needed.voidRender the html fragment for the given completion object.voidrenderFooter(org.apache.wicket.request.Response response, int count) Render the html footer fragment for the completion.voidrenderHeader(org.apache.wicket.request.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).Whatever is written to the response reaches the markup as is, without escaping. Any part of it that comes from user input or other dynamic content must be escaped before it is written, with
Strings#escapeMarkup(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).Whatever is written to the response reaches the markup as is, without escaping. Any part of it that comes from user input or other dynamic content must be escaped before it is written, with
Strings#escapeMarkup(CharSequence).- Parameters:
response-
-
detach
Override when needed.- Specified by:
detachin interfaceorg.apache.wicket.model.IDetachable
-