|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.core.RefDataClass
com.smartgwt.client.widgets.form.fields.FormItem
com.smartgwt.client.widgets.form.fields.CanvasItem
com.smartgwt.client.widgets.form.fields.PickTreeItem
public class PickTreeItem
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.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 |
---|
public PickTreeItem()
public PickTreeItem(JavaScriptObject jsObj)
public PickTreeItem(java.lang.String name)
public PickTreeItem(java.lang.String name, java.lang.String title)
Method Detail |
---|
public static PickTreeItem getOrCreateRef(JavaScriptObject jsObj)
public void setCanSelectParentItems(java.lang.Boolean canSelectParentItems)
canSelectParentItems
- canSelectParentItems Default value is nullSelection overview and related methods
,
Editing Examplepublic java.lang.Boolean getCanSelectParentItems()
Selection overview and related methods
,
Editing Examplepublic void setDisplayField(java.lang.String displayField)
dataSource
is unset), this is
implemented by picking up the value of the specified field from the valueTree
.dataSource
where the valueField
matches this item's value, and displaying
the displayField
value from that record.
setDisplayField
in class FormItem
displayField
- displayField Default value is nullFormItem.invalidateDisplayValueCache()
public java.lang.String getDisplayField()
dataSource
is unset), this is
implemented by picking up the value of the specified field from the valueTree
.dataSource
where the valueField
matches this item's value, and displaying
the displayField
value from that record.
getDisplayField
in class FormItem
FormItem.invalidateDisplayValueCache()
public void setEmptyMenuMessage(java.lang.String emptyMenuMessage)
Note : This is an advanced setting
emptyMenuMessage
- emptyMenuMessage Default value is "No items to display"public java.lang.String getEmptyMenuMessage()
public void setLoadDataOnDemand(java.lang.Boolean loadDataOnDemand)
Note : This is an advanced setting
loadDataOnDemand
- loadDataOnDemand Default value is nullpublic java.lang.Boolean getLoadDataOnDemand()
public void setOptionDataSource(DataSource optionDataSource)
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
setOptionDataSource
in class FormItem
optionDataSource
- optionDataSource Default value is nullpublic DataSource getOptionDataSource()
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
public void setValueField(java.lang.String valueField)
setValueField
in class FormItem
valueField
- valueField Default value is nullpublic java.lang.String getValueField()
getValueField
in class FormItem
public void fetchData()
optionDataSource
).
public void setDataSource(DataSource dataSource)
loadDataOnDemand
. Note : This is an advanced setting
dataSource
- dataSource Default value is nullpublic DataSource getDataSource()
DSRequest
. Can be specified as either a DataSource instance or the String ID of a DataSource.
public void setValueTree(Tree valueTree)
Tree
of options from which the user can select.
valueTree
- valueTree Default value is null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |