com.smartgwt.client.widgets.form.fields
Class MultiComboBoxItem

java.lang.Object
  extended by com.smartgwt.client.core.JsObject
      extended by com.smartgwt.client.core.DataClass
          extended by com.smartgwt.client.core.RefDataClass
              extended by com.smartgwt.client.widgets.form.fields.FormItem
                  extended by com.smartgwt.client.widgets.form.fields.CanvasItem
                      extended by com.smartgwt.client.widgets.form.fields.MultiComboBoxItem
All Implemented Interfaces:
HasHandlers, HasBlurHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasPickerIconClickHandlers, HasShowValueHandlers, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers

public class MultiComboBoxItem
extends CanvasItem

A MultiComboBoxItem is a combo box that allows the user to select multiple options. Each selected option is represented as a button that can be clicked to deselect the option. The relative layout of the buttons to the combo box is specified with the layoutStyle attribute. The buttons will be kept in the order that they were added, with the most recently added button being adjacent to the combo box. MultiComboBoxItem uses the AutoChild pattern to construct the combo box and the buttons so that they can be easily customized.

See Also:
ComboBoxItem

Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
MultiComboBoxItem()
           
MultiComboBoxItem(JavaScriptObject jsObj)
           
MultiComboBoxItem(String name)
           
MultiComboBoxItem(String name, String title)
           
 
Method Summary
 Boolean getAutoFetchData()
          Should the MultiComboBoxItem fetch data from the data source immediately or wait until the user first opens the pickList.
 Boolean getAutoFitButtons()
          Specifies whether to autofit the buttons in the MultiComboBoxItem.
 IButton getButtonDefaults()
          Default properties to be used in creating each IButton.
 IButton getButtonProperties()
          Properties to be used in creating each option button.
 ComboBoxItem getComboBoxDefaults()
          Default properties for the ComboBoxItem in a MultiComboBoxItem.
 ComboBoxItem getComboBoxProperties()
          Properties to be used in creating a ComboBoxItem.
 Integer getComboBoxWidth()
          Specifies the size of the combo box field.
 String getDisplayField()
          The displayField of the combo box.
 MultiComboBoxLayoutStyle getLayoutStyle()
          Specifies the layout style of the combo box and the buttons in the MultiComboBoxItem.
 DataSource getOptionDataSource()
          The optionDataSource of the combo box.
static MultiComboBoxItem getOrCreateRef(JavaScriptObject jsObj)
           
 Boolean getUseInsertionOrder()
          Specifies whether to arrange the buttons of the MultiComboBoxItem in the order that they were selected (the default), or to sort the buttons by displayField.
 String getValueField()
          The valueField of the combo box.
 void setAutoFetchData(Boolean autoFetchData)
          Should the MultiComboBoxItem fetch data from the data source immediately or wait until the user first opens the pickList.
 void setAutoFitButtons(Boolean autoFitButtons)
          Specifies whether to autofit the buttons in the MultiComboBoxItem.
 void setButtonProperties(IButton buttonProperties)
          Properties to be used in creating each option button.
 void setButtonProperties(JavaScriptObject buttonProperties)
          Properties to be used in creating each option button.
 void setComboBoxProperties(ComboBoxItem comboBoxProperties)
          Properties to be used in creating a ComboBoxItem.
 void setComboBoxProperties(JavaScriptObject comboBoxProperties)
          Properties to be used in creating a ComboBoxItem.
 void setComboBoxWidth(Integer comboBoxWidth)
          Specifies the size of the combo box field.
 void setDisplayField(String displayField)
          The displayField of the combo box.
 void setJavaScriptObject(JavaScriptObject jsObj)
           
 void setLayoutStyle(MultiComboBoxLayoutStyle layoutStyle)
          Specifies the layout style of the combo box and the buttons in the MultiComboBoxItem.
 void setOptionDataSource(DataSource optionDataSource)
          The optionDataSource of the combo box.
 void setUseInsertionOrder(Boolean useInsertionOrder)
          Specifies whether to arrange the buttons of the MultiComboBoxItem in the order that they were selected (the default), or to sort the buttons by displayField.
 void setValueField(String valueField)
          The valueField of the combo box.
 void showValue(Object displayValue, Object dataValue, DynamicForm form, CanvasItem item)
          This method will be called whenever this form item's value is being set via a programmatic call to e.g: DynamicForm.setValues or FormItem.setValue and may be overridden by CanvasItems intended to support displaying data values to update the embedded Canvas to reflect the value passed in.
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.CanvasItem
addShowValueHandler, createCanvas, getApplyPromptToCanvas, getAutoDestroy, getCanvas, getEditCriteriaInInnerForm, getOverflow, getPrompt, getShouldSaveValue, hasAdvancedCriteria, setApplyPromptToCanvas, setAutoDestroy, setCanEditCriterionPredicate, setCanvas, setCriterionGetter, setCriterionSetter, setEditCriteriaInInnerForm, setOverflow, setPrompt, setShouldSaveValue, setupCanvasConstructor, storeValue, storeValue, storeValue
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.FormItem
_getValue, addBlurHandler, addChangedHandler, addChangeHandler, addClickHandler, addDoubleClickHandler, addEditorEnterHandler, addEditorExitHandler, addFocusHandler, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addPickerIconClickHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, blurItem, canEditCriterion, clearValue, convertToFormItemArray, disable, enable, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getBrowserSpellCheck, getCanEdit, getCanFocus, getCellHeight, getCellStyle, getClassName, getConfig, getContainerWidget, getCriteriaField, getCriterion, getCriterion, getDataPath, getDateFormatter, getDecimalPad, getDecimalPrecision, getDefaultIconSrc, getDisabled, getDisableIconsOnReadOnly, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEditPendingCSSText, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getFetchMissingValues, getFieldName, getFilterLocally, getForm, getFullDataPath, getGlobalTabIndex, getHeight, getHint, getHintStyle, getHoverAlign, getHoverDelay, getHoverHeight, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getIcon, getIconHeight, getIconPageRect, getIconPrompt, getIconRect, getIconVAlign, getIconWidth, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getLocateItemBy, getMultipleValueSeparator, getName, getOperator, getOptionCriteria, getOptionFilterContext, getOptionOperationId, getPageLeft, getPageRect, getPageTop, getPickerIconHeight, getPickerIconName, getPickerIconPrompt, getPickerIconSrc, getPickerIconWidth, getPrintTextBoxStyle, getPrintTitleStyle, getRect, getRedrawOnChange, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRowSpan, getSaveOnEnter, getSelectedRecord, getSelectOnFocus, getShowDisabled, getShowErrorIcon, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowOverIcons, getShowPickerIcon, getShowTitle, getShowValueIconOnly, getStartRow, getStopOnError, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTextBoxStyle, getTimeFormatter, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValue, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getVisible, getVisibleHeight, getVisibleWidth, getWidth, getWrapTitle, hide, hideIcon, invalidateDisplayValueCache, isCreated, isDisabled, isDrawn, isVisible, redraw, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setBrowserSpellCheck, setCanEdit, setCanFocus, setCellHeight, setCellStyle, setColSpan, setColSpan, setCriteriaField, setCriterion, setDataPath, setDateFormatter, setDecimalPad, setDecimalPrecision, setDefaultIconSrc, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisableIconsOnReadOnly, setDisplayFormat, setDisplayFormat, setEditorType, setEditorValueFormatter, setEditorValueParser, setEditPendingCSSText, setEmptyDisplayValue, setEmptyValueIcon, setEndRow, setErrorFormatter, setErrorIconHeight, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setFetchMissingValues, setFilterLocally, setGlobalTabIndex, setHeight, setHeight, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverHeight, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setIconHeight, setIconPrompt, setIcons, setIconVAlign, setIconWidth, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setLeft, setLocateItemBy, setMultipleValueSeparator, setName, setOperator, setOptionCriteria, setOptionFilterContext, setOptionOperationId, setPickerIconHeight, setPickerIconName, setPickerIconPrompt, setPickerIconSrc, setPickerIconWidth, setPrintTextBoxStyle, setPrintTitleStyle, setProperty, setProperty, setProperty, setProperty, setProperty, setRedrawOnChange, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRowSpan, setSaveOnEnter, setSelectOnFocus, setShowDisabled, setShowErrorIcon, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIfCondition, setShowOverIcons, setShowPickerIcon, setShowTitle, setShowValueIconOnly, setStartRow, setStopOnError, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTextBoxStyle, setTimeFormatter, setTitle, setTitleAlign, setTitleColSpan, setTitleOrientation, setTitleStyle, setTitleVAlign, setTooltip, setTop, setType, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setVAlign, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setWidth, setWidth, setWrapTitle, shouldFetchMissingValue, shouldSaveOnEnter, show, showIcon, showPicker, stopHover, updateState, validate
 
Methods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef
 
Methods inherited from class com.smartgwt.client.core.DataClass
doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute
 
Methods inherited from class com.smartgwt.client.core.JsObject
setJsObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

MultiComboBoxItem

public MultiComboBoxItem()

MultiComboBoxItem

public MultiComboBoxItem(JavaScriptObject jsObj)

MultiComboBoxItem

public MultiComboBoxItem(String name)

MultiComboBoxItem

public MultiComboBoxItem(String name,
                         String title)
Method Detail

getOrCreateRef

public static MultiComboBoxItem getOrCreateRef(JavaScriptObject jsObj)

setJavaScriptObject

public void setJavaScriptObject(JavaScriptObject jsObj)
Overrides:
setJavaScriptObject in class CanvasItem

setAutoFetchData

public void setAutoFetchData(Boolean autoFetchData)
Should the MultiComboBoxItem fetch data from the data source immediately or wait until the user first opens the pickList.

Parameters:
autoFetchData - autoFetchData Default value is false
See Also:
ComboBoxItem.setAutoFetchData(java.lang.Boolean)

getAutoFetchData

public Boolean getAutoFetchData()
Should the MultiComboBoxItem fetch data from the data source immediately or wait until the user first opens the pickList.

Returns:
Boolean
See Also:
ComboBoxItem.getAutoFetchData()

setAutoFitButtons

public void setAutoFitButtons(Boolean autoFitButtons)
Specifies whether to autofit the buttons in the MultiComboBoxItem. The default value is true if layoutStyle is "flow", but false for a layoutStyle of "vertical" or "verticalReverse". If the layoutStyle is "horizontal" or "horizontalReverse" then the buttons will autofit regardless of the setting of this property.

If this method is called after the component has been drawn/initialized: Sets the autoFitButtons property.

Parameters:
autoFitButtons - whether to autofit the buttons. Default value is null

getAutoFitButtons

public Boolean getAutoFitButtons()
Specifies whether to autofit the buttons in the MultiComboBoxItem. The default value is true if layoutStyle is "flow", but false for a layoutStyle of "vertical" or "verticalReverse". If the layoutStyle is "horizontal" or "horizontalReverse" then the buttons will autofit regardless of the setting of this property.

Returns:
Boolean

setComboBoxWidth

public void setComboBoxWidth(Integer comboBoxWidth)
Specifies the size of the combo box field.

Note that this attribute only has an effect in "flow", "horizontal", and "horizontalReverse" modes. In the other modes, the combo box is as wide as the overall MultiComboBoxItem.

Parameters:
comboBoxWidth - comboBoxWidth Default value is null

getComboBoxWidth

public Integer getComboBoxWidth()
Specifies the size of the combo box field.

Note that this attribute only has an effect in "flow", "horizontal", and "horizontalReverse" modes. In the other modes, the combo box is as wide as the overall MultiComboBoxItem.

Returns:
Integer

setDisplayField

public void setDisplayField(String displayField)
The displayField of the combo box.

Note : This is an advanced setting

Overrides:
setDisplayField in class FormItem
Parameters:
displayField - . See String. Default value is null
See Also:
ComboBoxItem.setDisplayField(java.lang.String)

getDisplayField

public String getDisplayField()
The displayField of the combo box.

Overrides:
getDisplayField in class FormItem
Returns:
. See String
See Also:
ComboBoxItem.getDisplayField()

setLayoutStyle

public void setLayoutStyle(MultiComboBoxLayoutStyle layoutStyle)
Specifies the layout style of the combo box and the buttons in the MultiComboBoxItem. Available values are "flow" (the default), "horizontal", "horizontalReverse", "vertical", and "verticalReverse".

Parameters:
layoutStyle - the new layout style. Default value is "flow"

getLayoutStyle

public MultiComboBoxLayoutStyle getLayoutStyle()
Specifies the layout style of the combo box and the buttons in the MultiComboBoxItem. Available values are "flow" (the default), "horizontal", "horizontalReverse", "vertical", and "verticalReverse".

Returns:
MultiComboBoxLayoutStyle

setUseInsertionOrder

public void setUseInsertionOrder(Boolean useInsertionOrder)
Specifies whether to arrange the buttons of the MultiComboBoxItem in the order that they were selected (the default), or to sort the buttons by displayField.

Parameters:
useInsertionOrder - useInsertionOrder Default value is true

getUseInsertionOrder

public Boolean getUseInsertionOrder()
Specifies whether to arrange the buttons of the MultiComboBoxItem in the order that they were selected (the default), or to sort the buttons by displayField.

Returns:
Boolean

setValueField

public void setValueField(String valueField)
The valueField of the combo box.

Overrides:
setValueField in class FormItem
Parameters:
valueField - . See String. Default value is null
See Also:
ComboBoxItem.setValueField(java.lang.String)

getValueField

public String getValueField()
The valueField of the combo box.

Overrides:
getValueField in class FormItem
Returns:
. See String
See Also:
ComboBoxItem.getValueField()

showValue

public void showValue(Object displayValue,
                      Object dataValue,
                      DynamicForm form,
                      CanvasItem item)
This method will be called whenever this form item's value is being set via a programmatic call to e.g: DynamicForm.setValues or FormItem.setValue and may be overridden by CanvasItems intended to support displaying data values to update the embedded Canvas to reflect the value passed in.

Parameters:
displayValue - new display-value for the item. This is the value after applying any custom formatter or valueMap
dataValue - underlying data value for the item
form - the dynamicForm in which this item is contained
item - the live form item instance

getButtonDefaults

public IButton getButtonDefaults()
Default properties to be used in creating each IButton.

Returns:
IButton

setButtonProperties

public void setButtonProperties(JavaScriptObject buttonProperties)
Properties to be used in creating each option button.

Note : This is an advanced setting

Parameters:
buttonProperties - buttonProperties

setButtonProperties

public void setButtonProperties(IButton buttonProperties)
Properties to be used in creating each option button.

Note : This is an advanced setting

Parameters:
buttonProperties - buttonProperties

getButtonProperties

public IButton getButtonProperties()
Properties to be used in creating each option button.

Returns:
IButton

getComboBoxDefaults

public ComboBoxItem getComboBoxDefaults()
Default properties for the ComboBoxItem in a MultiComboBoxItem.

Returns:
ComboBoxItem

setComboBoxProperties

public void setComboBoxProperties(JavaScriptObject comboBoxProperties)
Properties to be used in creating a ComboBoxItem.

Note : This is an advanced setting

Parameters:
comboBoxProperties - comboBoxProperties Default value is null

setComboBoxProperties

public void setComboBoxProperties(ComboBoxItem comboBoxProperties)
Properties to be used in creating a ComboBoxItem.

Note : This is an advanced setting

Parameters:
comboBoxProperties - comboBoxProperties Default value is null

getComboBoxProperties

public ComboBoxItem getComboBoxProperties()
Properties to be used in creating a ComboBoxItem.

Returns:
ComboBoxItem

setOptionDataSource

public void setOptionDataSource(DataSource optionDataSource)
The optionDataSource of the combo box.

Overrides:
setOptionDataSource in class FormItem
Parameters:
optionDataSource - optionDataSource Default value is null
See Also:
ComboBoxItem.setOptionDataSource(com.smartgwt.client.data.DataSource)

getOptionDataSource

public DataSource getOptionDataSource()
The optionDataSource of the combo box.

Returns:
DataSource
See Also:
ComboBoxItem.getOptionDataSource()