Class WMultiSelectPair
- 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.WMultiSelect
-
- com.github.bordertech.wcomponents.WMultiSelectPair
-
- All Implemented Interfaces:
AjaxTarget
,AjaxTrigger
,BeanAware
,BeanBound
,BeanProviderBound
,DataBound
,Diagnosable
,Disableable
,Input
,Labelable
,Mandatable
,MultiInputComponent
,SelectionToggleable
,SubordinateTarget
,SubordinateTrigger
,WComponent
,WebComponent
,Serializable
public class WMultiSelectPair extends WMultiSelect implements AjaxTrigger, AjaxTarget, SubordinateTarget, MultiInputComponent
This component is functionally the same as
WMultiSelect
but it looks different. It has a list of options in a box on the left, and a box on the right containing the selected options. Add and Remove buttons enable users to select from the list of options.- Author:
- Ming Gao
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WMultiSelectPair.MultiSelectPairModel
Holds the extrinsic state information of the component.-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.WMultiSelect
WMultiSelect.MultiSelectModel
-
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 Modifier and Type Field Description static int
DEFAULT_ROWS
The default number of rows to display in the list boxes.-
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 WMultiSelectPair()
Creates an empty WMultiSelectPair.WMultiSelectPair(Object table)
Creates a WMultiSelectPair with the options provided by the given table.WMultiSelectPair(Object[] values)
Creates a WMultiSelectPair with the specified list of options.WMultiSelectPair(List aList)
Creates a WMultiSelectPair with the specified list of options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAvailableListName()
protected WMultiSelectPair.MultiSelectPairModel
getComponentModel()
Returns the effective component model for this component.protected WMultiSelectPair.MultiSelectPairModel
getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified.String
getSelectedListName()
protected boolean
isSelectionOrderable()
Override to return true if shuffle is enabled.boolean
isShuffle()
Indicates whether options in the selection list can be re-ordered (shuffled).protected WMultiSelectPair.MultiSelectPairModel
newComponentModel()
Creates a new Component model.void
setAvailableListName(String availableListName)
Sets the available list name.void
setSelectedListName(String selectedListName)
Sets the selected list name.void
setShuffle(boolean shuffle)
Sets whether options in the selection list can be re-ordered (shuffled).-
Methods inherited from class com.github.bordertech.wcomponents.WMultiSelect
getRows, setRows, toggleSelection
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWMultiSelectList
doHandleInvalidOption, doHandleRequest, getData, getMaxSelect, getMinSelect, getNewSelections, getNotSelected, getRequestValue, getSelected, getSelectedOptionsAsArray, getValue, getValueAsString, isEmpty, 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, 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
-
-
-
-
Field Detail
-
DEFAULT_ROWS
public static final int DEFAULT_ROWS
The default number of rows to display in the list boxes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WMultiSelectPair
public WMultiSelectPair()
Creates an empty WMultiSelectPair.
-
WMultiSelectPair
public WMultiSelectPair(List aList)
Creates a WMultiSelectPair with the specified list of options.- Parameters:
aList
- the list of available options.
-
WMultiSelectPair
public WMultiSelectPair(Object[] values)
Creates a WMultiSelectPair with the specified list of options.- Parameters:
values
- the list of available options.
-
WMultiSelectPair
public WMultiSelectPair(Object table)
Creates a WMultiSelectPair with the options provided by the given table.- Parameters:
table
- the table to obtain the list's options from.
-
-
Method Detail
-
getAvailableListName
public String getAvailableListName()
- Returns:
- Returns the available list name.
-
setAvailableListName
public void setAvailableListName(String availableListName)
Sets the available list name.- Parameters:
availableListName
- The availableListName to set.
-
getSelectedListName
public String getSelectedListName()
- Returns:
- Returns the selectedListName.
-
setSelectedListName
public void setSelectedListName(String selectedListName)
Sets the selected list name.- Parameters:
selectedListName
- The selectedListName to set.
-
isShuffle
public boolean isShuffle()
Indicates whether options in the selection list can be re-ordered (shuffled). The default value is false (no shuffle).- Returns:
- true if shuffle is enabled, false otherwise.
-
setShuffle
public void setShuffle(boolean shuffle)
Sets whether options in the selection list can be re-ordered (shuffled).- Parameters:
shuffle
- true if shuffle is enabled, false otherwise.
-
isSelectionOrderable
protected boolean isSelectionOrderable()
Override to return true if shuffle is enabled.- Overrides:
isSelectionOrderable
in classAbstractWSelectList
- Returns:
- true if shuffle is enabled, false otherwise.
-
newComponentModel
protected WMultiSelectPair.MultiSelectPairModel newComponentModel()
Creates a new Component model.- Overrides:
newComponentModel
in classWMultiSelect
- Returns:
- a new MultiSelectPairModel.
-
getComponentModel
protected WMultiSelectPair.MultiSelectPairModel getComponentModel()
Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.- Overrides:
getComponentModel
in classWMultiSelect
- Returns:
- the effective component model
-
getOrCreateComponentModel
protected WMultiSelectPair.MultiSelectPairModel getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.- Overrides:
getOrCreateComponentModel
in classWMultiSelect
- Returns:
- the model for this component
-
-