|
|||||||||
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.ComboBoxItem
public class ComboBoxItem
The Combobox is a text input field which can show a list of options via a drop-down PickList.
The set of options
will be filtered based on the current value in the text field, so only options that match what has been typed so far
will be displayed. The set of options can be derived from a ValueMap or dynamically retrieved from a dataSource. See
the com.smartgwt.client..PickList
interface for further settings.
Note that to select the first option as a
default value for the item, defaultToFirstOption
may be set.
Field Summary |
---|
Fields inherited from class com.smartgwt.client.core.JsObject |
---|
jsObj |
Constructor Summary | |
---|---|
ComboBoxItem()
|
|
ComboBoxItem(JavaScriptObject jsObj)
|
|
ComboBoxItem(String name)
|
|
ComboBoxItem(String name,
String title)
|
Method Summary | |
---|---|
HandlerRegistration |
addDataArrivedHandler(DataArrivedHandler handler)
Add a dataArrived handler. |
void |
defaultDynamicValue()
Expression evaluated to determine the defaultValue when no value is provided for this item. |
void |
fetchData()
|
void |
fetchData(DSCallback callback)
Only applies to databound items (see optionDataSource ).Performs a fetch type operation on this item's DataSource to retrieve the set of valid options for the item, based on the current pickListCriteria . |
void |
fetchData(DSCallback callback,
DSRequest requestProperties)
Only applies to databound items (see optionDataSource ).Performs a fetch type operation on this item's DataSource to retrieve the set of valid options for the item, based on the current pickListCriteria . |
ListGridRecord[] |
filterClientPickListData()
Returns the data to display in the pick list. |
Boolean |
getAnimatePickList()
If true, when the pickList is shown, it will be shown via an animated reveal effect |
int |
getAnimationTime()
If this.animatePickList is true - this specifies the duration of the animation effect applied when showing the pickList |
Boolean |
getAutoFetchData()
If this combo box retrieves its options from a dataSource , should options be fetched from the server when
the item is first written out, or should this fetch be delayed until the user opens the pickList. |
ListGridRecord[] |
getClientPickListData()
Returns the set of data to be displayed in this item's PickList. |
Boolean |
getCompleteOnTab()
If true, when the pickList is showing, the user can select the current value by hitting the Tab key. |
Boolean |
getDefaultToFirstOption()
Select the first option as the default value for this ComboBoxItem. |
Boolean |
getDefaultValue()
Static default value for this ComboBoxItem. |
String |
getDisplayField()
Specifies an alternative field from which display values should be retrieved for this item. |
String |
getDisplayFieldName()
Returns the displayField for this form item. |
int |
getEmptyPickListHeight()
Height for an empty pick list (showing the empty message), if the pick list has no records and hideEmptyPickList is false . |
String |
getEmptyPickListMessage()
Empty message to display in the pickList if hideEmptyPickList is false . |
Integer |
getFetchDelay()
For a ComboBox or other pickList that accepts user-entered criteria, how many millseconds to wait after the last user keystroke before fetching data from the server. |
Boolean |
getFilterLocally()
If filterLocally is set for this item, and this item is showing options from a dataSource, fetch the
entire set of options from the server, and use these values to map the item value to the appropriate display value. |
Boolean |
getFilterWithValue()
Read-only property set by the ComboBoxItem to indicate whether we should use the current typed-in value as part of the filter criteria returned by getPickListFilterCriteria() . |
Boolean |
getHideEmptyPickList()
If this pickList contains no options, should it be hidden? If unset, default behavior is to allow the empty pickList to show if it is databound. |
DataSource |
getOptionDataSource()
|
String |
getOptionOperationId()
If this item has a specified optionDataSource , this attribute may be set to specify an explicit operationId when performing a fetch against the option dataSource to
pick up display value mapping. |
static ComboBoxItem |
getOrCreateRef(JavaScriptObject jsObj)
|
Integer |
getPickerIconHeight()
Don't specify an explicit height for the picker icon - instead have it size to match the height of the combo box item. |
String |
getPickerIconSrc()
Src for the picker icon. |
String |
getPickListBaseStyle()
Base Style for pickList cells. |
Criteria |
getPickListCriteria()
If this item has a databound pick-list (for example optionDataSource is set) this property can be used to provide static filter criteria when retrieving the data
for the pickList. |
protected Criteria |
getPickListFilterCriteria()
Returns filter criteria for options displayed for this item. |
int |
getPickListHeaderHeight()
If this pick list is showing multiple fields, this property determines the height of the column headers for those fields. |
int |
getPickListHeight()
Maximum height to show the pick list before it starts to scroll. |
Integer |
getPickListWidth()
Default width to show the pickList. |
ListGridRecord |
getSelectedRecord()
Returns the entire record object associated with the current value for this item (or null if no matching record exists in the PickList data). |
Boolean |
getShowAllOptions()
If true, even non-matching options will be shown, with configurable 'separator rows' in between. |
Boolean |
getShowHintInField()
If showing a hint for this form item, should it be shown within the field? |
Boolean |
getShowOptionsFromDataSource()
If this item is part of a databound form, and has a specified valueMap , by default we show the valueMap
options in the pickList for the item. |
Boolean |
getShowPickerIcon()
Show the picker icon for the ComboBox. |
Boolean |
getShowPickListOnKeypress()
Should the list of options be displayed whenever the user types into the the combo-box textArea, or only when the user clicks on the pick button or uses the explicit Alt+Arrow Down key combination? |
String |
getSortField()
Specifies the field by which this item should be initially sorted. |
Integer |
getSortFieldAsInt()
Specifies the field by which this item should be initially sorted. |
TextMatchStyle |
getTextMatchStyle()
When applying filter criteria to pickList data, what type of matching to use. |
String |
getValueField()
If this form item maps data values to display values by retrieving the displayField values from an 'optionDataSource' , this property denotes the the
field to use as the underlying data value in records from the optionDataSource.If unset, assumed to be the name of this form item. |
String |
getValueFieldName()
Getter method to retrieve the valueField for this
item. |
String |
getValueIconField()
For Databound formItems, this property determines which column valueIcons should show up in for this formItem's pickList.If unset valueIcons show up in the displayField column if specified, otherwise
the valueField column.In most cases only the displayField or valueField will be visible. |
void |
setAnimatePickList(Boolean animatePickList)
If true, when the pickList is shown, it will be shown via an animated reveal effect |
void |
setAnimationTime(int animationTime)
If this.animatePickList is true - this specifies the duration of the animation effect applied when showing the pickList |
void |
setAutoFetchData(Boolean autoFetchData)
If this combo box retrieves its options from a dataSource , should options be fetched from the server when
the item is first written out, or should this fetch be delayed until the user opens the pickList. |
void |
setCompleteOnTab(Boolean completeOnTab)
If true, when the pickList is showing, the user can select the current value by hitting the Tab key. |
void |
setDefaultToFirstOption(Boolean defaultToFirstOption)
Select the first option as the default value for this ComboBoxItem. |
void |
setDefaultValue(Boolean defaultValue)
Static default value for this ComboBoxItem. |
void |
setDisplayField(String displayField)
Specifies an alternative field from which display values should be retrieved for this item. |
void |
setEmptyPickListHeight(int emptyPickListHeight)
Height for an empty pick list (showing the empty message), if the pick list has no records and hideEmptyPickList is false . |
void |
setEmptyPickListMessage(String emptyPickListMessage)
Empty message to display in the pickList if hideEmptyPickList is false . |
void |
setFetchDelay(Integer fetchDelay)
For a ComboBox or other pickList that accepts user-entered criteria, how many millseconds to wait after the last user keystroke before fetching data from the server. |
void |
setFilterLocally(Boolean filterLocally)
If filterLocally is set for this item, and this item is showing options from a dataSource, fetch the
entire set of options from the server, and use these values to map the item value to the appropriate display value. |
void |
setHideEmptyPickList(Boolean hideEmptyPickList)
If this pickList contains no options, should it be hidden? If unset, default behavior is to allow the empty pickList to show if it is databound. |
void |
setOptionDataSource(DataSource dataSource)
If set, this FormItem will derive data to show in the PickList by fetching records from the specified optionDataSource . |
void |
setOptionOperationId(String optionOperationId)
If this item has a specified optionDataSource , this attribute may be set to specify an explicit operationId when performing a fetch against the option dataSource to
pick up display value mapping. |
void |
setPickerIconHeight(Integer pickerIconHeight)
Don't specify an explicit height for the picker icon - instead have it size to match the height of the combo box item. |
void |
setPickerIconSrc(String pickerIconSrc)
Src for the picker icon. |
void |
setPickListBaseStyle(String pickListBaseStyle)
Base Style for pickList cells. |
void |
setPickListCriteria(Criteria pickListCriteria)
If this item has a databound pick-list (for example optionDataSource is set) this property can be used to provide static filter criteria when retrieving the data
for the pickList. |
void |
setPickListCriteria(DSRequest optionFilterContext)
|
void |
setPickListFields(ListGridField... pickListFields)
|
void |
setPickListFilterCriteriaFunction(FilterCriteriaFunction filterCriteriaFunction)
Set the pick list filter criteria function / handler. |
void |
setPickListHeaderHeight(int pickListHeaderHeight)
If this pick list is showing multiple fields, this property determines the height of the column headers for those fields. |
void |
setPickListHeight(int pickListHeight)
Maximum height to show the pick list before it starts to scroll. |
void |
setPickListWidth(Integer pickListWidth)
Default width to show the pickList. |
void |
setSeparatorRows(ListGridRecord[] separatorRows)
Array of records to show between matching and non-matching rows in the PickList. |
void |
setShowAllOptions(Boolean showAllOptions)
If true, even non-matching options will be shown, with configurable 'separator rows' in between. |
void |
setShowHintInField(Boolean showHintInField)
If showing a hint for this form item, should it be shown within the field? |
void |
setShowOptionsFromDataSource(Boolean showOptionsFromDataSource)
If this item is part of a databound form, and has a specified valueMap , by default we show the valueMap
options in the pickList for the item. |
void |
setShowPickerIcon(Boolean showPickerIcon)
Show the picker icon for the ComboBox. |
void |
setShowPickListOnKeypress(Boolean showPickListOnKeypress)
Should the list of options be displayed whenever the user types into the the combo-box textArea, or only when the user clicks on the pick button or uses the explicit Alt+Arrow Down key combination? |
void |
setSortField(Integer sortField)
Specifies the field by which this item should be initially sorted. |
void |
setSortField(String sortField)
Specifies the field by which this item should be initially sorted. |
void |
setTextMatchStyle(TextMatchStyle textMatchStyle)
When applying filter criteria to pickList data, what type of matching to use. |
void |
setValueField(String valueField)
If this form item maps data values to display values by retrieving the displayField values from an 'optionDataSource' , this property denotes the the
field to use as the underlying data value in records from the optionDataSource.If unset, assumed to be the name of this form item. |
void |
setValueIconField(String valueIconField)
For Databound formItems, this property determines which column valueIcons should show up in for this formItem's pickList.If unset valueIcons show up in the displayField column if specified, otherwise
the valueField column.In most cases only the displayField or valueField will be visible. |
Methods inherited from class com.smartgwt.client.core.RefDataClass |
---|
getRef, getRef |
Methods inherited from class com.smartgwt.client.core.DataClass |
---|
doAddHandler, fireEvent, getAttributeAsIntArray, getAttributeAsMap, getAttributeAsObject, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, 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 ComboBoxItem()
public ComboBoxItem(JavaScriptObject jsObj)
public ComboBoxItem(String name)
public ComboBoxItem(String name, String title)
Method Detail |
---|
public static ComboBoxItem getOrCreateRef(JavaScriptObject jsObj)
public void setDefaultValue(Boolean defaultValue)
defaultToFirstOption
instead.
setDefaultValue
in class FormItem
defaultValue
- defaultValue Default value is nullpublic Boolean getDefaultValue()
defaultToFirstOption
instead.
public void setDefaultToFirstOption(Boolean defaultToFirstOption)
defaultValue
and defaultDynamicValue()
.
defaultToFirstOption
- defaultToFirstOption Default value is falsepublic Boolean getDefaultToFirstOption()
defaultValue
and defaultDynamicValue()
.
public void setShowHintInField(Boolean showHintInField)
CSS style for the hint is textBoxStyle
with the suffix "Hint" appended to it.
Note : This is an advanced setting
showHintInField
- showHintInField Default value is nullpublic Boolean getShowHintInField()
CSS style for the hint is textBoxStyle
with the suffix "Hint" appended to it.
public void setShowPickerIcon(Boolean showPickerIcon)
Note : This is an advanced setting
setShowPickerIcon
in class FormItem
showPickerIcon
- showPickerIcon Default value is truepublic Boolean getShowPickerIcon()
getShowPickerIcon
in class FormItem
public void setPickerIconHeight(Integer pickerIconHeight)
setPickerIconHeight
in class FormItem
pickerIconHeight
- pickerIconHeight Default value is nullpublic Integer getPickerIconHeight()
getPickerIconHeight
in class FormItem
public void setPickerIconSrc(String pickerIconSrc)
Note : This is an advanced setting
setPickerIconSrc
in class FormItem
pickerIconSrc
- pickerIconSrc Default value is "[SKIN]/DynamicForm/ComboBoxItem_PickButton_icon.gif"public String getPickerIconSrc()
getPickerIconSrc
in class FormItem
public void setShowPickListOnKeypress(Boolean showPickListOnKeypress)
Alt+Arrow Down
key combination?
showPickListOnKeypress
- showPickListOnKeypress Default value is truepublic Boolean getShowPickListOnKeypress()
Alt+Arrow Down
key combination?
public void setCompleteOnTab(Boolean completeOnTab)
Tab
key.
completeOnTab
- completeOnTab Default value is nullpublic Boolean getCompleteOnTab()
Tab
key.
public void setOptionOperationId(String optionOperationId)
optionDataSource
, this attribute may be set to specify an explicit operationId
when performing a fetch against the option dataSource to
pick up display value mapping.
setOptionOperationId
in class FormItem
optionOperationId
- optionOperationId Default value is nullpublic String getOptionOperationId()
optionDataSource
, this attribute may be set to specify an explicit operationId
when performing a fetch against the option dataSource to
pick up display value mapping.
getOptionOperationId
in class FormItem
public void setDisplayField(String displayField)
The display field can be
either another field value in the same record or a field that must be retrieved from a related 'optionDataSource'
.
If this item is not
databound (optionDataSource
is unset), or
bound to the same dataSource as the form as a whole, this item will call DynamicForm.getValue(java.lang.String)
the form named after is implemented by picking up the value of
the specified field from the Form's values object.
Otherwise this item will attempt to map its underlying value to a
display value by retrieving a record from the optionDataSource
where the valueField
matches this item's value, and displaying the
displayField
value from that record. Note that if optionDataSource
is set and this value is
not set, FormItem.getDisplayFieldName()
will return the dataSource title
field by default.
This essentially enables the specified optionDataSource
to be used as a server based
valueMap.
Note : This is an advanced setting
setDisplayField
in interface PickList
setDisplayField
in class FormItem
displayField
- displayField Default value is nullpublic String getDisplayField()
The display field can be
either another field value in the same record or a field that must be retrieved from a related 'optionDataSource'
.
If this item is not
databound (optionDataSource
is unset), or
bound to the same dataSource as the form as a whole, this item will call DynamicForm.getValue(java.lang.String)
the form named after is implemented by picking up the value of
the specified field from the Form's values object.
Otherwise this item will attempt to map its underlying value to a
display value by retrieving a record from the optionDataSource
where the valueField
matches this item's value, and displaying the
displayField
value from that record. Note that if optionDataSource
is set and this value is
not set, FormItem.getDisplayFieldName()
will return the dataSource title
field by default.
This essentially enables the specified optionDataSource
to be used as a server based
valueMap.
getDisplayField
in interface PickList
getDisplayField
in class FormItem
public void setValueField(String valueField)
displayField
values from an 'optionDataSource'
, this property denotes the the
field to use as the underlying data value in records from the optionDataSource.name
of this form item.
setValueField
in interface PickList
setValueField
in class FormItem
valueField
- valueField Default value is nullpublic String getValueField()
displayField
values from an 'optionDataSource'
, this property denotes the the
field to use as the underlying data value in records from the optionDataSource.name
of this form item.
getValueField
in interface PickList
getValueField
in class FormItem
public void setFilterLocally(Boolean filterLocally)
filterLocally
is set for this item, and this item is showing options from a dataSource, fetch the
entire set of options from the server, and use these values to map the item value to the appropriate display value. Also
use "local"
type filtering on drop down list of options. This means data will only be fetched once from the server, and then filtered on the client.
Note : This is an advanced setting
setFilterLocally
in interface PickList
setFilterLocally
in class FormItem
filterLocally
- filterLocally Default value is falsepublic Boolean getFilterLocally()
filterLocally
is set for this item, and this item is showing options from a dataSource, fetch the
entire set of options from the server, and use these values to map the item value to the appropriate display value. Also
use "local"
type filtering on drop down list of options. This means data will only be fetched once from the server, and then filtered on the client.
getFilterLocally
in interface PickList
getFilterLocally
in class FormItem
public void setShowOptionsFromDataSource(Boolean showOptionsFromDataSource)
valueMap
, by default we show the valueMap
options in the pickList for the item. Setting this property to true will ensure that the options displayed in our
pickList are derived from the form's dataSource
.
Note : This is an advanced setting
setShowOptionsFromDataSource
in interface PickList
showOptionsFromDataSource
- showOptionsFromDataSource Default value is nullpublic Boolean getShowOptionsFromDataSource()
valueMap
, by default we show the valueMap
options in the pickList for the item. Setting this property to true will ensure that the options displayed in our
pickList are derived from the form's dataSource
.
getShowOptionsFromDataSource
in interface PickList
public void setAutoFetchData(Boolean autoFetchData)
dataSource
, should options be fetched from the server when
the item is first written out, or should this fetch be delayed until the user opens the pickList.
Note : This is an advanced setting
autoFetchData
- autoFetchData Default value is falsepublic Boolean getAutoFetchData()
dataSource
, should options be fetched from the server when
the item is first written out, or should this fetch be delayed until the user opens the pickList.
public Boolean getFilterWithValue()
getPickListFilterCriteria()
.
You can check this flag in order to mimic the ComboBoxItem's default behavior if you provide a custom implementation of
getPickListFilterCriteria()
.
public void setShowAllOptions(Boolean showAllOptions)
'separator rows'
in between. Not valid for
'databound pickLists'
.
setShowAllOptions
in interface PickList
showAllOptions
- showAllOptions Default value is nullpublic Boolean getShowAllOptions()
'separator rows'
in between. Not valid for
'databound pickLists'
.
getShowAllOptions
in interface PickList
public void defaultDynamicValue()
defaultValue
when no value is provided for this item. To default to the first option use defaultToFirstOption
instead.
public String getDisplayFieldName()
displayField
for this form item. If
unset, and optionDataSource
is explicitly
specified, this method will return the title field for the optionDataSource
getDisplayFieldName
in interface PickList
getDisplayFieldName
in class FormItem
public String getValueFieldName()
valueField
for this
item. If unset, default behavior will return the name
of this field.
getValueFieldName
in interface PickList
getValueFieldName
in class FormItem
optionDataSource
public HandlerRegistration addDataArrivedHandler(DataArrivedHandler handler)
If this item is showing a dataBound pickList, this notification method will be fired when new data arrives from the server.
addDataArrivedHandler
in interface HasDataArrivedHandlers
handler
- the dataArrived handler
HandlerRegistration
used to remove this handlerprotected Criteria getPickListFilterCriteria()
public void setPickListHeight(int pickListHeight)
setPickListHeight
in interface PickList
pickListHeight
- pickListHeight Default value is 300public int getPickListHeight()
getPickListHeight
in interface PickList
public void setEmptyPickListHeight(int emptyPickListHeight)
hideEmptyPickList
is false
.
setEmptyPickListHeight
in interface PickList
emptyPickListHeight
- emptyPickListHeight Default value is 100public int getEmptyPickListHeight()
hideEmptyPickList
is false
.
getEmptyPickListHeight
in interface PickList
public void setEmptyPickListMessage(String emptyPickListMessage)
hideEmptyPickList
is false
. Note : This is an advanced setting
setEmptyPickListMessage
in interface PickList
emptyPickListMessage
- emptyPickListMessage Default value is nullpublic String getEmptyPickListMessage()
hideEmptyPickList
is false
.
getEmptyPickListMessage
in interface PickList
public void setHideEmptyPickList(Boolean hideEmptyPickList)
setHideEmptyPickList
in interface PickList
hideEmptyPickList
- hideEmptyPickList Default value is nullpublic Boolean getHideEmptyPickList()
getHideEmptyPickList
in interface PickList
public void setPickListWidth(Integer pickListWidth)
setPickListWidth
in interface PickList
pickListWidth
- pickListWidth Default value is nullpublic Integer getPickListWidth()
getPickListWidth
in interface PickList
public void setTextMatchStyle(TextMatchStyle textMatchStyle)
For a databound pickList (optionDataSource
set), textMatchStyle
is sent to the server as textMatchStyle
.
For a non-databound pickList,
textMatchStyle
is applied by PickList.filterClientPickListData()
.
setTextMatchStyle
in interface PickList
textMatchStyle
- textMatchStyle Default value is "startsWith"public TextMatchStyle getTextMatchStyle()
For a databound pickList (optionDataSource
set), textMatchStyle
is sent to the server as textMatchStyle
.
For a non-databound pickList,
textMatchStyle
is applied by PickList.filterClientPickListData()
.
getTextMatchStyle
in interface PickList
public void setPickListBaseStyle(String pickListBaseStyle)
setPickListBaseStyle
in interface PickList
pickListBaseStyle
- pickListBaseStyle Default value is "pickListCell"public String getPickListBaseStyle()
getPickListBaseStyle
in interface PickList
public void setAnimatePickList(Boolean animatePickList)
Note : This is an advanced setting
setAnimatePickList
in interface PickList
animatePickList
- animatePickList Default value is nullpublic Boolean getAnimatePickList()
getAnimatePickList
in interface PickList
public void setAnimationTime(int animationTime)
Note : This is an advanced setting
setAnimationTime
in interface PickList
animationTime
- animationTime Default value is 200public int getAnimationTime()
getAnimationTime
in interface PickList
public void setPickListHeaderHeight(int pickListHeaderHeight)
setPickListHeaderHeight
in interface PickList
pickListHeaderHeight
- pickListHeaderHeight Default value is 22public int getPickListHeaderHeight()
getPickListHeaderHeight
in interface PickList
public void setValueIconField(String valueIconField)
valueIcons
should show up in for this formItem's pickList.displayField
column if specified, otherwise
the valueField
column.displayField
or valueField
will be visible. This property is typically only
required if custom pickListFields
have been specfied for this item. Note : This is an advanced setting
setValueIconField
in interface PickList
valueIconField
- valueIconField Default value is nullpublic String getValueIconField()
valueIcons
should show up in for this formItem's pickList.displayField
column if specified, otherwise
the valueField
column.displayField
or valueField
will be visible. This property is typically only
required if custom pickListFields
have been specfied for this item.
getValueIconField
in interface PickList
public void setPickListCriteria(Criteria pickListCriteria)
optionDataSource
is set) this property can be used to provide static filter criteria when retrieving the data
for the pickList. Note : This is an advanced setting
setPickListCriteria
in interface PickList
pickListCriteria
- pickListCriteria Default value is nullpublic Criteria getPickListCriteria()
optionDataSource
is set) this property can be used to provide static filter criteria when retrieving the data
for the pickList.
getPickListCriteria
in interface PickList
public void setPickListCriteria(DSRequest optionFilterContext)
public void setFetchDelay(Integer fetchDelay)
PickList
setFetchDelay
in interface PickList
fetchDelay
- the fetch delay. defaults to 200mspublic Integer getFetchDelay()
PickList
getFetchDelay
in interface PickList
public void setSortField(String sortField)
'field name'
or the index of the field in the fields Array.
Note that if sortField
is initally specified as a number, it will be converted to a string (field name)
after the item is initialized. To programmatically change sort field or direction after initialization, call ${isc.DocUtils.linkForRef('sort')}.
sortField
- sortField Default value is nullpublic String getSortField()
'field name'
or the index of the field in the fields Array.
Note that if sortField
is initally specified as a number, it will be converted to a string (field name)
after the item is initialized. To programmatically change sort field or direction after initialization, call ${isc.DocUtils.linkForRef('sort')}.
public void setSortField(Integer sortField)
'field name'
or the index of the field in the fields Array.
Note that if sortField
is initally specified as a number, it will be converted to a string (field name)
after the item is initialized. To programmatically change sort field or direction after initialization, call ${isc.DocUtils.linkForRef('sort')}.
sortField
- sortField Default value is nullpublic Integer getSortFieldAsInt()
'field name'
or the index of the field in the fields Array.
Note that if sortField
is initally specified as a number, it will be converted to a string (field name)
after the item is initialized. To programmatically change sort field or direction after initialization, call ${isc.DocUtils.linkForRef('sort')}.
public void setOptionDataSource(DataSource dataSource)
optionDataSource
. The fetched data will be used as a valueMap
by extracting the valueField
and
displayField
in the loaded records, to
derive one valueMap entry per record loaded from the optionDataSource. Multiple fields from the fetched data may
be shown in the pickList by setting pickListFields
. The data will be retrieved via a "fetch" operation on the DataSource, passing the pickListCriteria
(if set) as criteria, and passing optionFilterContext
(if set) as
DSRequest properties.
The fetch will be triggered when the pickList is first shown, or, you can set autoFetchData
to fetch when the FormItem is
first drawn. You can also call com.smartgwt.client.widgets.form.fields.PickList#fetchData
at any time to manually trigger
a fetch.
Data paging is automatically enabled if the optionDataSource supports it. As the pickList is scrolled by the user, requests for additional data will be automatically issued.
For a pickList attached to a
ComboBoxItem, new fetches are issued as the user types, with criteria set as described under getPickListFilterCriteria()
. If your dataSource is not
capable of filtering results by search criteria (eg the dataSource is backed by an XML flat file), you can set
filterLocally
to have the entire
dataset loaded up front and filtering performed in the browser. This disables data paging.
Setting
optionDataSource also enables the basic optionDataSource
behaviors, eg, fetching individual display values before the pickList is shown.
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.
Note : This is an advanced setting
setOptionDataSource
in interface PickList
setOptionDataSource
in class FormItem
dataSource
- optionDataSource Default value is nullpublic DataSource getOptionDataSource()
getOptionDataSource
in interface PickList
public void setSeparatorRows(ListGridRecord[] separatorRows)
Not valid for optionDataSource
.
setSeparatorRows
in interface PickList
separatorRows
- separatorRows Default value is [{isSeparator:true}]public void fetchData()
public void fetchData(DSCallback callback)
optionDataSource
).pickListCriteria
.
callback
- Callback to fire when the fetch completes. Callback will fire with 2 parameters:
item
a pointer to the form item and dsResponse
the DSResponse
returned by the server.public void fetchData(DSCallback callback, DSRequest requestProperties)
optionDataSource
).pickListCriteria
.
callback
- Callback to fire when the fetch completes. Callback will fire with 2
parameters: item
a pointer to the form item and
dsResponse
the DSResponse
returned by the
server.requestProperties
- properties to apply to the dsRequest for this fetch.public ListGridRecord[] filterClientPickListData()
PickList
The default implementation applies the criteria returned by #getPickListFilterCriteria
to the data returned
by PickList.getClientPickListData()
. A record passes the filter if it has a matching value for all fields in the criteria
object. Matching is performed according to textMatchStyle
.
If showAllOptions
is set, all values are shown, with matching values shown below a
separator
.
filterClientPickListData
in interface PickList
public ListGridRecord[] getClientPickListData()
PickList
This method will be called for non-databound form items implementing the PickList interface. The default implementation will derive data from the item's valueMap - can be overridden to allow a custom set of options to be displayed.
Note that for PickLists that filter data based on user input 'ComboBox')
, this method should
return the data before filtering.
getClientPickListData
in interface PickList
public void setPickListFields(ListGridField... pickListFields)
public ListGridRecord getSelectedRecord()
public void setPickListFilterCriteriaFunction(FilterCriteriaFunction filterCriteriaFunction)
setPickListFilterCriteriaFunction
in interface PickList
filterCriteriaFunction
- the filter criteria function
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |