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

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.PickTreeItem
All Implemented Interfaces:
HasHandlers, HasBlurHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasShowValueHandlers, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers
Direct Known Subclasses:
IPickTreeItem

public class PickTreeItem
extends CanvasItem

FormItem that allows picking a value from a hierarchical data model.


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
PickTreeItem()
           
PickTreeItem(JavaScriptObject jsObj)
           
PickTreeItem(java.lang.String name)
           
PickTreeItem(java.lang.String name, java.lang.String title)
           
 
Method Summary
 void fetchData()
          Only applies to databound items (see optionDataSource).
Performs a fetch type operation on this item's DataSource to retrieve/refresh the tree of data displayed as rows in this items menu.
 java.lang.Boolean getCanSelectParentItems()
          If true, clicking or pressing Enter on a menu item that has a submenu will select that item (with standard behavior of hiding the menus, calling click handlers, etc) instead of showing the submenu.
 DataSource getDataSource()
          The DataSource that this component should bind to for default fields and for performing DSRequest.
 java.lang.String getDisplayField()
          Specifies an alternative field from which display values should be retrieved for this item.
If this item is not databound (dataSource is unset), this is implemented by picking up the value of the specified field from the valueTree.
Otherwise this item will attempt to map its underlying value to a display value by retrieving a record from the dataSource where the valueField matches this item's value, and displaying the displayField value from that record.
 java.lang.String getEmptyMenuMessage()
          This message will be displayed as a single, disabled option in any empty menu/submenu created from this item's data tree.
 java.lang.Boolean getLoadDataOnDemand()
          If this is a databound item, should the load our set of possible options be loaded on demand (as submenus are displayed), or upfront?
 DataSource getOptionDataSource()
          If set, this FormItem will map stored values to display values as though a ValueMap were specified, by fetching records from the specified optionDataSource and extracting the valueField and displayField in loaded records, to derive one valueMap entry per record loaded from the optionDataSource.
static PickTreeItem getOrCreateRef(JavaScriptObject jsObj)
           
 java.lang.String getValueField()
          Which field in the tree-data should be returned as this item's value? If unspecified, the path will be used
 void setCanSelectParentItems(java.lang.Boolean canSelectParentItems)
          If true, clicking or pressing Enter on a menu item that has a submenu will select that item (with standard behavior of hiding the menus, calling click handlers, etc) instead of showing the submenu.
 void setDataSource(DataSource dataSource)
          If specified, the tree of possible options will be derived from the dataSource as a ResultTree, rather than using this.valueTree.
 void setDisplayField(java.lang.String displayField)
          Specifies an alternative field from which display values should be retrieved for this item.
If this item is not databound (dataSource is unset), this is implemented by picking up the value of the specified field from the valueTree.
Otherwise this item will attempt to map its underlying value to a display value by retrieving a record from the dataSource where the valueField matches this item's value, and displaying the displayField value from that record.
 void setEmptyMenuMessage(java.lang.String emptyMenuMessage)
          This message will be displayed as a single, disabled option in any empty menu/submenu created from this item's data tree.
 void setLoadDataOnDemand(java.lang.Boolean loadDataOnDemand)
          If this is a databound item, should the load our set of possible options be loaded on demand (as submenus are displayed), or upfront?
 void setOptionDataSource(DataSource optionDataSource)
          If set, this FormItem will map stored values to display values as though a ValueMap were specified, by fetching records from the specified optionDataSource and extracting the valueField and displayField in loaded records, to derive one valueMap entry per record loaded from the optionDataSource.
 void setValueField(java.lang.String valueField)
          Which field in the tree-data should be returned as this item's value? If unspecified, the path will be used
 void setValueTree(Tree valueTree)
          A Tree of options from which the user can select.
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.CanvasItem
addShowValueHandler, canEditCriterion, createCanvas, getCanvas, getCriterion, getEditCriteriaInInnerForm, getOverflow, getShouldSaveValue, hasAdvancedCriteria, setCanvas, setCriterion, setEditCriteriaInInnerForm, setOverflow, setShouldSaveValue, setupCanvasConstructor, storeValue, storeValue, storeValue
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.FormItem
addBlurHandler, addChangedHandler, addChangeHandler, addClickHandler, addDoubleClickHandler, addFocusHandler, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, blurItem, clearValue, disable, enable, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getBrowserSpellCheck, getCanFocus, getCellHeight, getCellStyle, getConfig, getContainerWidget, getCriteriaField, getCriterion, getDataPath, getDateFormatter, getDefaultIconSrc, getDisabled, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, 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, getPickerIconSrc, getPickerIconWidth, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getRect, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRowSpan, 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, getValue, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getVisible, getVisibleHeight, getVisibleWidth, getWidth, getWrapTitle, hide, invalidateDisplayValueCache, isCreated, isDisabled, isDrawn, redraw, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setBrowserSpellCheck, setCanFocus, setCellHeight, setCellStyle, setColSpan, setColSpan, setCriteriaField, setDataPath, setDateFormatter, setDefaultIconSrc, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisplayFormat, setDisplayFormat, setEditorType, setEditorValueFormatter, setEditorValueParser, 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, setPickerIconSrc, setPickerIconWidth, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRowSpan, 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, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setWidth, setWidth, setWrapTitle, shouldFetchMissingValue, show, 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, 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

PickTreeItem

public PickTreeItem()

PickTreeItem

public PickTreeItem(JavaScriptObject jsObj)

PickTreeItem

public PickTreeItem(java.lang.String name)

PickTreeItem

public PickTreeItem(java.lang.String name,
                    java.lang.String title)
Method Detail

getOrCreateRef

public static PickTreeItem getOrCreateRef(JavaScriptObject jsObj)

setCanSelectParentItems

public void setCanSelectParentItems(java.lang.Boolean canSelectParentItems)
If true, clicking or pressing Enter on a menu item that has a submenu will select that item (with standard behavior of hiding the menus, calling click handlers, etc) instead of showing the submenu.

Parameters:
canSelectParentItems - canSelectParentItems Default value is null
See Also:
Selection overview and related methods, Editing Example

getCanSelectParentItems

public java.lang.Boolean getCanSelectParentItems()
If true, clicking or pressing Enter on a menu item that has a submenu will select that item (with standard behavior of hiding the menus, calling click handlers, etc) instead of showing the submenu.

Returns:
Boolean
See Also:
Selection overview and related methods, Editing Example

setDisplayField

public void setDisplayField(java.lang.String displayField)
Specifies an alternative field from which display values should be retrieved for this item.
If this item is not databound (dataSource is unset), this is implemented by picking up the value of the specified field from the valueTree.
Otherwise this item will attempt to map its underlying value to a display value by retrieving a record from the dataSource where the valueField matches this item's value, and displaying the displayField value from that record.

Overrides:
setDisplayField in class FormItem
Parameters:
displayField - displayField Default value is null
See Also:
FormItem.invalidateDisplayValueCache()

getDisplayField

public java.lang.String getDisplayField()
Specifies an alternative field from which display values should be retrieved for this item.
If this item is not databound (dataSource is unset), this is implemented by picking up the value of the specified field from the valueTree.
Otherwise this item will attempt to map its underlying value to a display value by retrieving a record from the dataSource where the valueField matches this item's value, and displaying the displayField value from that record.

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

setEmptyMenuMessage

public void setEmptyMenuMessage(java.lang.String emptyMenuMessage)
This message will be displayed as a single, disabled option in any empty menu/submenu created from this item's data tree.

Note : This is an advanced setting

Parameters:
emptyMenuMessage - emptyMenuMessage Default value is "No items to display"
See Also:
Tree Example

getEmptyMenuMessage

public java.lang.String getEmptyMenuMessage()
This message will be displayed as a single, disabled option in any empty menu/submenu created from this item's data tree.

Returns:
String
See Also:
Tree Example

setLoadDataOnDemand

public void setLoadDataOnDemand(java.lang.Boolean loadDataOnDemand)
If this is a databound item, should the load our set of possible options be loaded on demand (as submenus are displayed), or upfront?

Note : This is an advanced setting

Parameters:
loadDataOnDemand - loadDataOnDemand Default value is null

getLoadDataOnDemand

public java.lang.Boolean getLoadDataOnDemand()
If this is a databound item, should the load our set of possible options be loaded on demand (as submenus are displayed), or upfront?

Returns:
Boolean

setOptionDataSource

public void setOptionDataSource(DataSource optionDataSource)
If set, this FormItem will map stored values to display values as though a ValueMap were specified, by fetching records from the specified optionDataSource and extracting the valueField and displayField in loaded records, to derive one valueMap entry per record loaded from the optionDataSource.

With the default setting of fetchMissingValues, fetches will be initiated against the optionDataSource any time the FormItem has a non-null value and no corresponding display value is available. This includes when the form is first initialized, as well as any subsequent calls to FormItem.setValue, such as may happen when DynamicForm.editRecord is called. Retrieved values are automatically cached by the FormItem.

Note that if a normal, static valueMap is also specified for the field (either directly in the form item or as part of the field definition in the dataSource), it will be preferred to the data derived from the optionDataSource for whatever mappings are present.

In a databound form, if displayField is specified for a FormItem and optionDataSource is unset, optionDataSource will default to the form's current DataSource

Overrides:
setOptionDataSource in class FormItem
Parameters:
optionDataSource - optionDataSource Default value is null
See Also:
List - Combo Box Example

getOptionDataSource

public DataSource getOptionDataSource()
If set, this FormItem will map stored values to display values as though a ValueMap were specified, by fetching records from the specified optionDataSource and extracting the valueField and displayField in loaded records, to derive one valueMap entry per record loaded from the optionDataSource.

With the default setting of fetchMissingValues, fetches will be initiated against the optionDataSource any time the FormItem has a non-null value and no corresponding display value is available. This includes when the form is first initialized, as well as any subsequent calls to FormItem.setValue, such as may happen when DynamicForm.editRecord is called. Retrieved values are automatically cached by the FormItem.

Note that if a normal, static valueMap is also specified for the field (either directly in the form item or as part of the field definition in the dataSource), it will be preferred to the data derived from the optionDataSource for whatever mappings are present.

In a databound form, if displayField is specified for a FormItem and optionDataSource is unset, optionDataSource will default to the form's current DataSource

Returns:
DataSource
See Also:
List - Combo Box Example

setValueField

public void setValueField(java.lang.String valueField)
Which field in the tree-data should be returned as this item's value? If unspecified, the path will be used

Overrides:
setValueField in class FormItem
Parameters:
valueField - valueField Default value is null
See Also:
Tree Example

getValueField

public java.lang.String getValueField()
Which field in the tree-data should be returned as this item's value? If unspecified, the path will be used

Overrides:
getValueField in class FormItem
Returns:
String
See Also:
Tree Example

fetchData

public void fetchData()
Only applies to databound items (see optionDataSource).
Performs a fetch type operation on this item's DataSource to retrieve/refresh the tree of data displayed as rows in this items menu.


setDataSource

public void setDataSource(DataSource dataSource)
If specified, the tree of possible options will be derived from the dataSource as a ResultTree, rather than using this.valueTree. Options can be loaded on demand or up front according to loadDataOnDemand.

Note : This is an advanced setting

Parameters:
dataSource - dataSource Default value is null

getDataSource

public DataSource getDataSource()
The DataSource that this component should bind to for default fields and for performing DSRequest.

Can be specified as either a DataSource instance or the String ID of a DataSource.

Returns:
DataSource

setValueTree

public void setValueTree(Tree valueTree)
A Tree of options from which the user can select.

Parameters:
valueTree - valueTree Default value is null