public class AutoSuggestFormElementBuilder extends FormControlElementBuilderSupport<AutoSuggestFormElement,AutoSuggestFormElementBuilder>
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_DATA_PROPERTY |
static String |
CSS_EMPTY_TEMPLATE |
static String |
CSS_ITEM_TEMPLATE |
static String |
CSS_PREFILL_TABLE |
static String |
CSS_SUGGESTION_TEMPLATE |
static String |
CSS_TYPEAHEAD
CSS class put on the textbox, that will actually be initialized as the typeahead control.
|
static String |
CSS_TYPEAHEAD_ITEM_CLASS |
static String |
CSS_TYPEAHEAD_MODULE
CSS class on the wrapper, representing the autosuggest (typeahead) component.
|
static String |
CSS_TYPEAHEAD_VALUE |
static String |
DEFAULT_PROPERTY |
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(AutoSuggestFormElementConfiguration configuration)
Set the configuration for the autosuggest control.
|
protected AutoSuggestFormElement |
createElement(com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext) |
AutoSuggestFormElementBuilder |
endpoint(String endpoint)
Configure the endpoint that this control should use to retrieve suggestions.
|
AutoSuggestFormElementBuilder |
idProperty(String idProperty) |
AutoSuggestFormElementBuilder |
itemTemplate(com.foreach.across.modules.web.ui.ViewElement containerTemplate,
com.foreach.across.modules.web.ui.ViewElement itemTemplate)
Use a custom
ViewElement that will be used as a template for the rendering of selected suggestions. |
AutoSuggestFormElementBuilder |
linkBuilder(java.util.function.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(com.foreach.across.modules.web.ui.ViewElement notFoundTemplate) |
AutoSuggestFormElementBuilder |
notFoundTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder notFoundTemplate) |
AutoSuggestFormElementBuilder |
prefill(List<Map<String,Object>> prefillValues) |
AutoSuggestFormElementBuilder |
properties(String... properties) |
protected void |
registerWebResources(com.foreach.across.modules.web.resource.WebResourceRegistry webResourceRegistry) |
AutoSuggestFormElementBuilder |
suggestionTemplate(com.foreach.across.modules.web.ui.ViewElement template)
com.foreach.across.modules.bootstrapui.elements.builder.AutoSuggestFormElementBuilder#suggestionTemplate |
AutoSuggestFormElementBuilder |
suggestionTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom
ViewElementBuilder that will be used as a template for the rendering of suggestions
in the suggestion dropdown. |
apply, controlName, disabled, disabled, getControlName, getDisabled, getReadonly, getRequired, readonly, readonly, required, required
attribute, attributes, clearAttributes, css, htmlId, removeAttribute, removeCss
add, add, addAll, addFirst, addFirst, sort
build, configure, customTemplate, name, postProcess, postProcessor
public static final String ATTRIBUTE_DATA_PROPERTY
public static final String CSS_TYPEAHEAD_MODULE
public static final String CSS_TYPEAHEAD
public static final String CSS_TYPEAHEAD_VALUE
public static final String CSS_TYPEAHEAD_ITEM_CLASS
public static final String CSS_PREFILL_TABLE
public static final String CSS_SUGGESTION_TEMPLATE
public static final String CSS_ITEM_TEMPLATE
public static final String CSS_EMPTY_TEMPLATE
public static final String DEFAULT_PROPERTY
public AutoSuggestFormElementBuilder configuration(@NonNull AutoSuggestFormElementConfiguration configuration)
configuration
- to usepublic AutoSuggestFormElementBuilder idProperty(String idProperty)
public AutoSuggestFormElementBuilder prefill(List<Map<String,Object>> prefillValues)
public AutoSuggestFormElementBuilder properties(String... properties)
public AutoSuggestFormElementBuilder endpoint(String endpoint)
endpoint
- urlpublic AutoSuggestFormElementBuilder notFoundTemplate(com.foreach.across.modules.web.ui.ViewElement notFoundTemplate)
public AutoSuggestFormElementBuilder notFoundTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder notFoundTemplate)
public AutoSuggestFormElementBuilder suggestionTemplate(com.foreach.across.modules.web.ui.ViewElementBuilder template)
Use a custom ViewElementBuilder
that will be used as a template for the rendering of suggestions
in the suggestion dropdown.
If you want to reuse properties from this AutoSuggestFormElementBuilder
instance, make sure to add an attribute ATTRIBUTE_DATA_PROPERTY
to the node element which inner HTML should
be replaced.
public AutoSuggestFormElementBuilder suggestionTemplate(com.foreach.across.modules.web.ui.ViewElement template)
com.foreach.across.modules.bootstrapui.elements.builder.AutoSuggestFormElementBuilder#suggestionTemplate
public AutoSuggestFormElementBuilder itemTemplate(com.foreach.across.modules.web.ui.ViewElement containerTemplate, com.foreach.across.modules.web.ui.ViewElement itemTemplate)
Use a custom ViewElement
that will be used as a template for the rendering of selected suggestions.
The given ContainerViewElementBuilder
will contain all selected suggestions. The container may not have child nodes
The given itemTemplate must contain a node with class CSS_ITEM_TEMPLATE
. This childnode will be repeated
for all selected suggestions.
If you want to reuse properties from this AutoSuggestFormElementBuilder
instance, make sure to add an
attribute ATTRIBUTE_DATA_PROPERTY
to the node element which inner HTML should be replaced
public AutoSuggestFormElementBuilder linkBuilder(java.util.function.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 © 2018. All rights reserved.