public class AutoSuggestFormElementBuilder extends FormControlElementBuilderSupport<AutoSuggestFormElement,AutoSuggestFormElementBuilder>
| Modifier and Type | Field and Description |
|---|---|
static String |
CSS_TYPEAHEAD
CSS class put on the textbox, that will actually be initialized as the typeahead control.
|
static String |
CSS_TYPEAHEAD_MODULE
CSS class on the wrapper, representing the autosuggest (typeahead) component.
|
static String |
CSS_TYPEAHEAD_VALUE |
| Constructor and Description |
|---|
AutoSuggestFormElementBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildLink(String link,
com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext) |
AutoSuggestFormElementBuilder |
configuration(@NonNull AutoSuggestFormElementConfiguration configuration)
Set the configuration for the autosuggest control.
|
protected AutoSuggestFormElement |
createElement(com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext) |
AutoSuggestFormElementBuilder |
footerTemplate(String name,
com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as template as footer of the suggestions fetched for the default dataset |
AutoSuggestFormElementBuilder |
footerTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as template as footer of the suggestions fetched for the default dataset |
AutoSuggestFormElementBuilder |
headerTemplate(String name,
com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as template as the header of the suggestions fetched for the default dataset |
AutoSuggestFormElementBuilder |
headerTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as template as the header of the suggestions fetched for the default dataset |
AutoSuggestFormElementBuilder |
linkBuilder(Function<String,String> linkBuilder)
Set a conversion function that should be applied to all url type properties
when setting them as the attribute for the generated links.
|
AutoSuggestFormElementBuilder |
notFoundTemplate(String datasetId,
com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as template when there are no suggestions found
for the specified dataset. |
AutoSuggestFormElementBuilder |
notFoundTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as template when there are no suggestions found
for the default dataset. |
AutoSuggestFormElementBuilder |
pendingTemplate(String name,
com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as template for the default dataset when synchronous results
are not available, but asynchronous results are expected. |
AutoSuggestFormElementBuilder |
pendingTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as template for the default dataset when synchronous results
are not available, but asynchronous results are expected. |
protected void |
registerWebResources(com.foreach.across.modules.web.resource.WebResourceRegistry webResourceRegistry) |
AutoSuggestFormElementBuilder |
suggestionTemplate(String datasetId,
com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as template for the rendering of suggestions
in the suggestion dropdown for a specific dataset. |
AutoSuggestFormElementBuilder |
suggestionTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as template for the rendering of suggestions
of the default dataset in the suggestion dropdown. |
apply, controlName, disabled, disabled, getControlName, getDisabled, getReadonly, getRequired, readonly, readonly, required, requiredattribute, attributes, clearAttributes, css, htmlId, removeAttribute, removeCssadd, add, addAll, addFirst, addFirst, sortbuild, configure, customTemplate, elementSupplier, elementSupplier, name, postProcess, postProcessor, withclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final String CSS_TYPEAHEAD_MODULE
public static final String CSS_TYPEAHEAD
public static final String CSS_TYPEAHEAD_VALUE
public AutoSuggestFormElementBuilder configuration(@NonNull @NonNull AutoSuggestFormElementConfiguration configuration)
configuration - to usepublic AutoSuggestFormElementBuilder notFoundTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder that will be used as template when there are no suggestions found
for the default dataset.
template - that should be usednotFoundTemplate(String, ViewElementBuilder)public AutoSuggestFormElementBuilder notFoundTemplate(String datasetId, com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder that will be used as template when there are no suggestions found
for the specified dataset.
datasetId - id of the datasettemplate - that should be usedpublic AutoSuggestFormElementBuilder suggestionTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder that will be used as template for the rendering of suggestions
of the default dataset in the suggestion dropdown. The template will be applied to each suggestion and the
associated suggestion object will be available within the context.
The default template for suggestions is <div>{{value}}</div>.
template - that should be usedsuggestionTemplate(String, ViewElementBuilder)public AutoSuggestFormElementBuilder suggestionTemplate(String datasetId, com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder that will be used as template for the rendering of suggestions
in the suggestion dropdown for a specific dataset. The template will be applied to each suggestion and the
associated suggestion object will be available within the context.
The default template for suggestions is <div>{{value}}</div>.
datasetId - id of the datasettemplate - that should be usedpublic AutoSuggestFormElementBuilder pendingTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder that will be used as template for the default dataset when synchronous results
are not available, but asynchronous results are expected. The current query can be used in the template,
for example <div>Loading results for {{query}}...</div>
template - that should be usedpendingTemplate(String, ViewElementBuilder)public AutoSuggestFormElementBuilder pendingTemplate(String name, com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder that will be used as template for the default dataset when synchronous results
are not available, but asynchronous results are expected. The current query can be used in the template,
for example <div>Loading results for {{query}}...</div>
template - that should be usedpublic AutoSuggestFormElementBuilder headerTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder that will be used as template as the header of the suggestions fetched for the default dataset
template - that should be usedheaderTemplate(String, ViewElementBuilder)public AutoSuggestFormElementBuilder headerTemplate(String name, com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder that will be used as template as the header of the suggestions fetched for the default dataset
template - that should be usedpublic AutoSuggestFormElementBuilder footerTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder that will be used as template as footer of the suggestions fetched for the default dataset
template - that should be usedheaderTemplate(String, ViewElementBuilder)public AutoSuggestFormElementBuilder footerTemplate(String name, com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder that will be used as template as footer of the suggestions fetched for the default dataset
template - that should be usedpublic AutoSuggestFormElementBuilder linkBuilder(Function<String,String> linkBuilder)
ViewElementBuilderContext.buildLink(String).
You can suppress the default behaviour by setting this property to Function.identity().linkBuilder - to use for translating the urlsprotected AutoSuggestFormElement createElement(com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext)
createElement in class com.foreach.across.modules.web.ui.ViewElementBuilderSupport<AutoSuggestFormElement,AutoSuggestFormElementBuilder>protected String buildLink(String link, com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext)
protected void registerWebResources(com.foreach.across.modules.web.resource.WebResourceRegistry webResourceRegistry)
registerWebResources in class com.foreach.across.modules.web.ui.ViewElementBuilderSupport<AutoSuggestFormElement,AutoSuggestFormElementBuilder>Copyright © 2020. All rights reserved.