public class Tagify
extends javax.faces.component.html.HtmlInputText
implements org.primefaces.component.api.Widget, org.primefaces.component.api.InputHolder
| Modifier and Type | Class and Description |
|---|---|
static class |
Tagify.PropertyKeys |
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_FAMILY |
static String |
COMPONENT_TYPE |
static Boolean |
DEFAULT_ADD_TAG_ON_BLUR |
static Boolean |
DEFAULT_AUTOCOMPLETE_TAGS |
static String |
DEFAULT_BACKSPACE |
static String |
DEFAULT_DELIMITERS |
static String |
DEFAULT_DROPDOWN_CLASSNAME |
static boolean |
DEFAULT_DROPDOWN_CLOSE_ON_SELECT |
static Long |
DEFAULT_DROPDOWN_ENABLED |
static boolean |
DEFAULT_DROPDOWN_FUZZY_SEARCH |
static boolean |
DEFAULT_DROPDOWN_HIGHLIGHT_FIRST |
static Long |
DEFAULT_DROPDOWN_MAX_ITEMS |
static Boolean |
DEFAULT_DUPLICATES |
static Long |
DEFAULT_EDIT_TAGS |
static Boolean |
DEFAULT_ENFORCE_WHITELIST |
static String |
DEFAULT_EXTENDER |
static Boolean |
DEFAULT_KEEP_INVALID_TAGS |
static Object |
DEFAULT_LIST_CONVERTER |
static Long |
DEFAULT_MAX_TAGS |
static String |
DEFAULT_MODE |
static String |
DEFAULT_PATTERN |
static String |
DEFAULT_RENDERER |
static Boolean |
DEFAULT_SKIP_INVALID |
static String |
STYLE_CLASS |
| Constructor and Description |
|---|
Tagify() |
getAccesskey, getAlt, getAutocomplete, getDefaultEventName, getDir, getLabel, getLang, getMaxlength, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getRole, getSize, getStyle, getStyleClass, getTabindex, getTitle, isDisabled, isReadonly, setAccesskey, setAlt, setAutocomplete, setDir, setDisabled, setLabel, setLang, setMaxlength, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setReadonly, setRole, setSize, setStyle, setStyleClass, setTabindex, setTitleaddValidator, addValueChangeListener, clearInitialState, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValue, getValueChangeListener, getValueChangeListeners, isEmpty, isImmediate, isLocalValueSet, isRequired, isValid, markInitialState, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, restoreState, saveState, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validategetConverter, getLocalValue, setConverteraddClientBehavior, addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEventencodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTreeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final String COMPONENT_FAMILY
public static final String COMPONENT_TYPE
public static final String DEFAULT_RENDERER
public static final String DEFAULT_DELIMITERS
public static final String DEFAULT_EXTENDER
public static final String DEFAULT_PATTERN
public static final String DEFAULT_BACKSPACE
public static final String DEFAULT_MODE
public static final String DEFAULT_DROPDOWN_CLASSNAME
public static final Long DEFAULT_EDIT_TAGS
public static final Long DEFAULT_MAX_TAGS
public static final Long DEFAULT_DROPDOWN_ENABLED
public static final Long DEFAULT_DROPDOWN_MAX_ITEMS
public static final Boolean DEFAULT_DUPLICATES
public static final Boolean DEFAULT_ENFORCE_WHITELIST
public static final Boolean DEFAULT_AUTOCOMPLETE_TAGS
public static final Boolean DEFAULT_ADD_TAG_ON_BLUR
public static final Boolean DEFAULT_KEEP_INVALID_TAGS
public static final Boolean DEFAULT_SKIP_INVALID
public static final Object DEFAULT_LIST_CONVERTER
public static final boolean DEFAULT_DROPDOWN_FUZZY_SEARCH
public static final boolean DEFAULT_DROPDOWN_HIGHLIGHT_FIRST
public static final boolean DEFAULT_DROPDOWN_CLOSE_ON_SELECT
public static final String STYLE_CLASS
public Collection<String> getEventNames()
getEventNames in interface javax.faces.component.behavior.ClientBehaviorHoldergetEventNames in class javax.faces.component.html.HtmlInputTextpublic String getFamily()
getFamily in class javax.faces.component.UIInputpublic String getInputClientId()
getInputClientId in interface org.primefaces.component.api.InputHolderpublic String getValidatableInputClientId()
getValidatableInputClientId in interface org.primefaces.component.api.InputHolderpublic String getLabelledBy()
getLabelledBy in interface org.primefaces.component.api.InputHolderpublic void setLabelledBy(String labelledBy)
setLabelledBy in interface org.primefaces.component.api.InputHolderpublic String resolveWidgetVar()
resolveWidgetVar in interface org.primefaces.component.api.Widgetpublic String getWidgetVar()
public void setWidgetVar(String widgetVar)
public Object getListConverter()
String instead of a List.
Defaults to false.public void setListConverter(Object listConverter)
listConverter - A converter that converts between the model representation and the list of tags. This defaults
to null, which means the model must a List. You can use this, for example, to use a comma separated string
as a model. Note that this is separate from the UIOutput.getConverter(), which converts between a list item and its
string representation.public String getDelimiters()
,;.public void setDelimiters(String delimiters)
delimiters - Required string of delimiters - characters for separating tags. The first character is used as
default delimiter in the (hidden) original field.public String getPattern()
public void setPattern(String pattern)
pattern - A JavaScript RegExp for validating a tag. You may want to use the start-of-line and end-of-line
anchors.public String getDropdownClassname()
public void setDropdownClassname(String dropdownClassname)
dropdownClassname - Custom class name for the dropdown suggestions select box.public String getBackspace()
remove to remove the last tag,
none to take no action, or edit to put the last tag in edit mode.public void setBackspace(String backspace)
backspace - What should happen when backspace is pressed on an empty input. remove to remove the last
tag, none to take no action, or edit to put the last tag in edit mode.public String getMode()
normal for the default tag input. Use select for single-value dropdown-like select box.
Set to mix to allow mixed-content. The pattern setting must be set to some characterpublic void setMode(String mode)
mode - Use normal for the default tag input. Use select for single-value dropdown-like select
box. Set to mix to allow mixed-content. The pattern setting must be set to some characterpublic Long getEditTags()
1 for a single click, 2 for a double click,
and 0 to disable editing tags.public void setEditTags(Long editTags)
editTags - How many clicks are necessary to edit a tag. 1 for a single click, 2 for a double
click, and 0 to disable editing tags.public String getExtender()
beforeRender(tagify, cfg) and afterRender(tagify, cfg). The callbacks are
passed the current tagify instance and the current widget configuration. The beforeRender callback may
modify the cfg options.public void setExtender(String extender)
extender - An optional extender for customizing this tagify component via JavaScript. It must be a JavaScript
expression that evaluates to an object. The expression is evaluated in the global window context. It may contain
the following callbacks: beforeRender(tagify, cfg) and afterRender(tagify, cfg). The callbacks are
passed the current tagify instance and the current widget configuration. The beforeRender callback may
modify the cfg options.public Long getMaxTags()
public void setMaxTags(Long maxTags)
maxTags - Maximum number of allowed tags. A negative value means no limit.public Boolean isDuplicates()
public void setDuplicates(Boolean duplicates)
duplicates - Whether duplicate tags should be allowed.public Boolean isEnforceWhitelist()
public void setEnforceWhitelist(Boolean enforceWhitelist)
enforceWhitelist - Whether tags not in the whitelist should be disallowed.public Boolean isAutocompleteTags()
public void setAutocompleteTags(Boolean autocompleteTags)
autocompleteTags - Whether to try and autocomplete the input's value while typing (match from whitelist).public Boolean isAddTagOnBlur()
public void setAddTagOnBlur(Boolean addTagOnBlur)
addTagOnBlur - Whether to automatically add the entered text as a tag when a blur event happens.public Boolean isKeepInvalidTags()
public void setKeepInvalidTags(Boolean keepInvalidTags)
keepInvalidTags - Whether to remove tags which did not pass validation.public Long getDropdownEnabled()
public void setDropdownEnabled(Long dropdownEnabled)
dropdownEnabled - Minimum number of characters to input to show the suggestions list. A negative number
disables the dropdown.public Long getDropdownMaxItems()
public void setDropdownMaxItems(Long dropdownMaxItems)
dropdownMaxItems - Maximum items to show in the suggestions list dropdown. Must be a positive number, not
including zero.public Boolean isSkipInvalid()
public void setSkipInvalid(Boolean skipInvalid)
skipInvalid - Whether invalid tags are temporarily added before being automatically removed.public Boolean isDropdownFuzzySearch()
true, match all items containing the
current search term. When false, match all items beginning with the current search term.public void setDropdownFuzzySearch(Boolean dropdownFuzzySearch)
dropdownFuzzySearch - How to search for matching items in the dropdown list. When true, match all
items containing the current search term. When false, match all items beginning with the current search
term.public Boolean isDropdownHighlightFirst()
public void setDropdownHighlightFirst(Boolean dropdownHighlightFirst)
dropdownHighlightFirst - When a suggestions list is shown, highlight the first item, and also suggest it in
the input. The suggestion can be accepted with right arrow key.public Boolean isDropdownCloseOnSelect()
getDropdownEnabled() is set to 0 (which means always show dropdown on focus): Close the
dropdown after selecting an item.public void setDropdownCloseOnSelect(Boolean dropdownCloseOnSelect)
dropdownCloseOnSelect - If getDropdownEnabled() is set to 0 (which means always show dropdown
on focus): Close the dropdown after selecting an item.public List<?> getWhitelist()
isEnforceWhitelist() is enabled, any tags not in the whitelist
are forbidden. If #isAutocompleteTags() is enabled, tags in the whitelist are suggested to the user via
autocomplete.public void setWhitelist(List<?> whitelist)
whitelist - A list of tags that are allowed. If isEnforceWhitelist() is enabled, any tags not in the
whitelist are forbidden. If #isAutocompleteTags() is enabled, tags in the whitelist are suggested to the
user via autocomplete.public List<?> getBlacklist()
public void setBlacklist(List<?> blacklist)
blacklist - A list of tags which are not allowed.protected void validateValue(javax.faces.context.FacesContext context,
Object value)
validateValue in class javax.faces.component.UIInputpublic List<String> convertTagList(javax.faces.context.FacesContext context, List<?> values)
context - Current faces context.values - Black or whitelist to convert.public static void main(String[] args)
Copyright © 2020 XIMA MEDIA GmbH. All rights reserved.