Class WMultiDropdown
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.WBeanComponent
-
- com.github.bordertech.wcomponents.AbstractInput
-
- com.github.bordertech.wcomponents.AbstractWSelectList
-
- com.github.bordertech.wcomponents.AbstractWMultiSelectList
-
- com.github.bordertech.wcomponents.WMultiDropdown
-
- All Implemented Interfaces:
AjaxTarget
,AjaxTrigger
,BeanAware
,BeanBound
,BeanProviderBound
,DataBound
,Diagnosable
,Disableable
,Input
,Labelable
,Mandatable
,MultiInputComponent
,SubordinateTarget
,WComponent
,WebComponent
,Serializable
public class WMultiDropdown extends AbstractWMultiSelectList implements AjaxTrigger, AjaxTarget, SubordinateTarget, MultiInputComponent
The WMultiDropdown component allows multiple dropdown elements to be generated dynamically on the client, without requiring the page to be reloaded. This component takes its appearance and attributes from a regular drop down but allows for one or more items of text to be entered via the add link adjacent to the right of the input.
This component is useful in instances where the user needs to select one or more items into the interfaces for a particular field. For instance, the user may have one or more aliases that need to be entered into the system.
The following attributes can be set on WMultiDropdown:
- maxInputs: The maximum number of text inputs the user can add to the component. Client-side functionality will stop users adding more than the allowable number of inputs via the UI. This class chops off any excess inputs if an attempt is made to add them programmatically.
- Since:
- 1.0.0
- Author:
- Yiannis Paschalidis, Jonathan Austin
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWMultiSelectList
AbstractWMultiSelectList.MultiSelectionModel
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWSelectList
AbstractWSelectList.SelectionModel
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractInput
AbstractInput.InputModel
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWComponent
AbstractWComponent.WComponentRef
-
-
Field Summary
-
Fields inherited from class com.github.bordertech.wcomponents.AbstractWMultiSelectList
EMPTY, NO_SELECTION
-
Fields inherited from interface com.github.bordertech.wcomponents.WComponent
DEFAULT_APPLICATION_ID, DEFAULT_INTERNAL_ID, DEFAULT_NO_ID, ID_CONTEXT_SEPERATOR, ID_FRAMEWORK_ASSIGNED_SEPERATOR, ID_VALIDATION_PATTERN
-
-
Constructor Summary
Constructors Constructor Description WMultiDropdown()
Creates an empty WMultiDropdown.WMultiDropdown(Object table)
Creates a WMultiDropdown with the options provided by the given table.WMultiDropdown(Object[] options)
Creates a WMultiDropdown with the specified list of options.WMultiDropdown(List aList)
Creates a WMultiDropdown with the specified list of options.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getMaxInputs()
Deprecated.Use {AbstractWMultiSelectList.getMaxSelect()
insteadprotected List
getNewSelections(Request request)
Override getNewSelections to ensure that the max number of inputs is honoured and that there are no duplicates.void
setMaxInputs(int maxInputs)
Deprecated.Use {AbstractWMultiSelectList.setMaxSelect(int)
instead-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWMultiSelectList
doHandleInvalidOption, doHandleRequest, getComponentModel, getData, getMaxSelect, getMinSelect, getNotSelected, getOrCreateComponentModel, getRequestValue, getSelected, getSelectedOptionsAsArray, getValue, getValueAsString, isEmpty, newComponentModel, preparePaintComponent, setData, setMaxSelect, setMinSelect, setSelected, setSelected, validateComponent
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWSelectList
getAjaxTarget, getCode, getDesc, getDescEncode, getListCacheKey, getLookupTable, getOptionIndex, getOptions, isAjax, isAllowNoSelection, isEditable, isPresent, isSelectionOrderable, isSubmitOnChange, optionToCode, optionToCode, optionToString, setAjaxTarget, setDescEncode, setEditable, setLookupTable, setOptions, setOptions, setSubmitOnChange
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractInput
addValidator, beforeHandleRequest, createMandatoryDiagnostic, doHandleChanged, getActionCommand, getActionObject, getActionOnChange, getDefaultSubmitButton, getDiagnostics, getValidators, handleRequest, isChangedInLastRequest, isCurrentAjaxTrigger, isDisabled, isMandatory, isReadOnly, setActionObject, setActionOnChange, setChangedInLastRequest, setDefaultSubmitButton, setDisabled, setMandatory, setMandatory, setReadOnly, showErrorIndicatorsForComponent, showIndicatorsForComponent, showWarningIndicatorsForComponent, toString
-
Methods inherited from class com.github.bordertech.wcomponents.WBeanComponent
addBeanToScratchMap, doUpdateBeanValue, getBean, getBeanFromScratchMap, getBeanId, getBeanProperty, getBeanProvider, getBeanScratchMap, getBeanValue, isBeanInScratchMap, isChanged, isSearchAncestors, isUseRequestScopeScratchMap, removeBeanFromScratchMap, resetData, setBean, setBeanId, setBeanProperty, setBeanProvider, setSearchAncestors, updateBeanValue
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWComponent
addHtmlClass, addHtmlClass, addNotify, afterPaint, assertAddSupported, beforePaint, createErrorDiagnostic, createErrorDiagnostic, forward, getAccessibleText, getAttribute, getBaseUrl, getDefaultModel, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getScratchMap, getTabIndex, getTag, getTemplate, getTemplateMarkUp, getToolTip, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, paintComponent, preparePaint, removeAttribute, removeComponentModel, removeHtmlClass, removeHtmlClass, removeNotify, replaceWComponent, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFlag, setFocussed, setHidden, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContext, tidyUpUIContextForTree, validate, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.bordertech.wcomponents.BeanAware
getBean, getBeanProperty, getBeanValue, setBeanProperty
-
Methods inherited from interface com.github.bordertech.wcomponents.BeanBound
isSearchAncestors, setBean
-
Methods inherited from interface com.github.bordertech.wcomponents.BeanProviderBound
getBeanId, setBeanId, setBeanProvider
-
Methods inherited from interface com.github.bordertech.wcomponents.WComponent
addHtmlClass, addHtmlClass, forward, getAccessibleText, getAttribute, getBaseUrl, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getTabIndex, getTag, getToolTip, handleRequest, hasTabIndex, invokeLater, isDefaultState, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeHtmlClass, removeHtmlClass, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFocussed, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContextForTree, validate
-
-
-
-
Constructor Detail
-
WMultiDropdown
public WMultiDropdown()
Creates an empty WMultiDropdown.
-
WMultiDropdown
public WMultiDropdown(List aList)
Creates a WMultiDropdown with the specified list of options.- Parameters:
aList
- the list of available options.
-
WMultiDropdown
public WMultiDropdown(Object[] options)
Creates a WMultiDropdown with the specified list of options.- Parameters:
options
- the list of available options.
-
WMultiDropdown
public WMultiDropdown(Object table)
Creates a WMultiDropdown with the options provided by the given table.- Parameters:
table
- the table to obtain the list's options from.
-
-
Method Detail
-
setMaxInputs
@Deprecated public void setMaxInputs(int maxInputs)
Deprecated.Use {AbstractWMultiSelectList.setMaxSelect(int)
insteadSets the maximum allowable number of inputs.- Parameters:
maxInputs
- the maximum allowable number of inputs, or <=0 for unlimited inputs.
-
getMaxInputs
@Deprecated public int getMaxInputs()
Deprecated.Use {AbstractWMultiSelectList.getMaxSelect()
instead- Returns:
- the maximum allowable number of inputs
-
getNewSelections
protected List getNewSelections(Request request)
Override getNewSelections to ensure that the max number of inputs is honoured and that there are no duplicates. This should not normally occur, as the client side js should prevent it.- Overrides:
getNewSelections
in classAbstractWMultiSelectList
- Parameters:
request
- the current request- Returns:
- a list of selections that have been added in the given request.
-
-