Class sap.ui.commons.DropdownBoxModule: sap/ui/commons/DropdownBox

extends ComboBox

The control provides a field that allows end users to an entry out of a list of pre-defined items. The choosable items can be provided in the form of a complete ListBox, single ListItems.

Deprecated API:Since version 1.38. Instead, use the sap.m.ComboBox control.

Constructor Summary
new sap.ui.commons.DropdownBox(sId?, mSettings?)Constructor for a new DropdownBox.
Event Summary
searchHelp(oControlEvent)Event fired whenever the configured searchHelpItem is clicked or the searchHelpItem is configured and F4 key is pressed.
Events borrowed from class sap.ui.commons.ComboBox
Events borrowed from class sap.ui.commons.TextField
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.DropdownBox.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.DropdownBox with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.DropdownBox.getMetadata()Returns a metadata object for class sap.ui.commons.DropdownBox.
attachSearchHelp(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the searchHelp event of this sap.ui.commons.DropdownBox.
clearHistory()Using this method the history of the DropdownBox can be cleared.
detachSearchHelp(fnFunction, oListener)Detaches event handler fnFunction from the searchHelp event of this sap.ui.commons.DropdownBox.
fireSearchHelp(mArguments?)Fires event searchHelp to attached listeners.
getMaxHistoryItems()Gets current value of property maxHistoryItems.
getSearchHelpAdditionalText()Gets current value of property searchHelpAdditionalText.
getSearchHelpEnabled()Gets current value of property searchHelpEnabled.
getSearchHelpIcon()Gets current value of property searchHelpIcon.
getSearchHelpText()Gets current value of property searchHelpText.
getTooltip_AsString()Extends the method inherited from sap.ui.core.Element by providing information on Search Help access (if needed)
onAfterRendering(oEvent)Ensure that handed in ListBoxes are taken from the visible UI immediately.
onclick(oEvent)Handle the click event happening in the DropdownBox
onfocusin(oEvent)Handle focusin event Ensures the text gets selected when focus gets into the field
onkeydown(oEvent)Handle keydown event
onkeypress(oEvent)Handle keypress event
onkeyup(oEvent)Handle keyup event This must only be considered if it is from Backspace-key in IE or after paste.
onpaste(oEvent)Handle paste event
onsapdelete(oEvent)Handle pseudo event onsapdelete.
onsaphome(oEvent)Handle pseudo event onsaphome
onsapleft(oEvent)Move the cursor one step to the left (and adapt selection)
onsapright(oEvent)Move the cursor one step to the right (and adapt selection)
onsapshow(oEvent)Handle sapshow pseudo events on the control
onselect(oEvent)Handle the select event happening in the DropdownBox
setMaxHistoryItems(iMaxHistoryItems)Sets a new value for property maxHistoryItems.
setSearchHelpAdditionalText(sSearchHelpAdditionalText)Overwrite of Setter for property searchHelpAdditionalText.
setSearchHelpEnabled(bEnabled, sText, sAdditionalText, sIcon)Overwrite of Setter for property searchHelpEnabled.
setSearchHelpIcon(sSearchHelpIcon)Overwrite of Setter for property searchHelpIcon.
setSearchHelpText(sSearchHelpText)Overwrite of Setter for property searchHelpText.
Constructor Detail
new sap.ui.commons.DropdownBox(sId?, mSettings?)
Constructor for a new DropdownBox.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

In addition, all settings applicable to the base type sap.ui.commons.ComboBox can be used as well.

Parameters:
{string}sId? Id for the new control, generated automatically if no id is given
{object}mSettings? Initial settings for the new control
Deprecated:
Since version 1.38. Instead, use the sap.m.ComboBox control.
Event Detail
searchHelp(oControlEvent)
Event fired whenever the configured searchHelpItem is clicked or the searchHelpItem is configured and F4 key is pressed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.value The current value of the DropdownBox.
Method Detail
sap.ui.commons.DropdownBox.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.commons.DropdownBox with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.commons.ComboBox.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.commons.DropdownBox.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.DropdownBox.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachSearchHelp(oData?, fnFunction, oListener?): sap.ui.commons.DropdownBox
Attaches event handler fnFunction to the searchHelp event of this sap.ui.commons.DropdownBox.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.commons.DropdownBox itself.

Event fired whenever the configured searchHelpItem is clicked or the searchHelpItem is configured and F4 key is pressed.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.commons.DropdownBox itself
Returns:
{sap.ui.commons.DropdownBox} Reference to this in order to allow method chaining
clearHistory()
Using this method the history of the DropdownBox can be cleared. This might be necessary if the items of the DropdownBox have changed. Otherwise invalid items may appear in the history.
detachSearchHelp(fnFunction, oListener): sap.ui.commons.DropdownBox
Detaches event handler fnFunction from the searchHelp event of this sap.ui.commons.DropdownBox.

The passed function and listener object must match the ones used for event registration.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.commons.DropdownBox} Reference to this in order to allow method chaining
fireSearchHelp(mArguments?): sap.ui.commons.DropdownBox
Fires event searchHelp to attached listeners.

Expects the following event parameters:

  • value of type stringThe current value of the DropdownBox.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.commons.DropdownBox} Reference to this in order to allow method chaining
getMaxHistoryItems(): int
Gets current value of property maxHistoryItems.

Maximum number of history items in the list.

If 0 no history is displayed or stored. The history is locally stored on the client. Therefore do not activate this feature when this control handles confidential data.

Default value is 0.

Returns:
{int} Value of property maxHistoryItems
getSearchHelpAdditionalText(): string
Gets current value of property searchHelpAdditionalText.

(optional) The additional Text to use for the search help entry.

Returns:
{string} Value of property searchHelpAdditionalText
getSearchHelpEnabled(): boolean
Gets current value of property searchHelpEnabled.

Whether the DropdownBox's search help should be enabled.

Default value is false.

Returns:
{boolean} Value of property searchHelpEnabled
getSearchHelpIcon(): sap.ui.core.URI
Gets current value of property searchHelpIcon.

(optional) The URI of the icon to use for the search help entry.

Returns:
{sap.ui.core.URI} Value of property searchHelpIcon
getSearchHelpText(): string
Gets current value of property searchHelpText.

(optional) The text to use for the search help entry.

Returns:
{string} Value of property searchHelpText
getTooltip_AsString(): string
Extends the method inherited from sap.ui.core.Element by providing information on Search Help access (if needed)
Returns:
{string} string tooltip or undefined
onAfterRendering(oEvent)
Ensure that handed in ListBoxes are taken from the visible UI immediately.
Parameters:
{jQuery.Event}oEvent The event object.
onclick(oEvent)
Handle the click event happening in the DropdownBox
Parameters:
{jQuery.Event}oEvent The event object.
onfocusin(oEvent)
Handle focusin event Ensures the text gets selected when focus gets into the field
Parameters:
{jQuery.Event}oEvent the occuring event
onkeydown(oEvent)
Handle keydown event
Parameters:
{jQuery.Event}oEvent the occuring event
onkeypress(oEvent)
Handle keypress event
Parameters:
{jQuery.Event}oEvent the occuring event
onkeyup(oEvent)
Handle keyup event This must only be considered if it is from Backspace-key in IE or after paste. In case there is a keyup with a tab this results from being entered via tabbing and can be ignored, too.
Parameters:
{jQuery.Event}oEvent the occuring event
onpaste(oEvent)
Handle paste event
Parameters:
{jQuery.Event}oEvent the occuring event
onsapdelete(oEvent)
Handle pseudo event onsapdelete. If triggered with open dropdown and current item provided by history feature, removes the selected item from this instance's history.
Parameters:
{jQuery.Event}oEvent the occuring event
onsaphome(oEvent)
Handle pseudo event onsaphome
Parameters:
{jQuery.Event}oEvent the occuring event
onsapleft(oEvent)
Move the cursor one step to the left (and adapt selection)
Parameters:
{jQuery.Event}oEvent The event object.
onsapright(oEvent)
Move the cursor one step to the right (and adapt selection)
Parameters:
{jQuery.Event}oEvent The event object.
onsapshow(oEvent)
Handle sapshow pseudo events on the control
Parameters:
{jQuery.Event}oEvent The event object.
onselect(oEvent)
Handle the select event happening in the DropdownBox
Parameters:
{jQuery.Event}oEvent The event object.
setMaxHistoryItems(iMaxHistoryItems): sap.ui.commons.DropdownBox
Sets a new value for property maxHistoryItems.

Maximum number of history items in the list.

If 0 no history is displayed or stored. The history is locally stored on the client. Therefore do not activate this feature when this control handles confidential data.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 0.

Parameters:
{int}iMaxHistoryItems New value for property maxHistoryItems
Returns:
{sap.ui.commons.DropdownBox} Reference to this in order to allow method chaining
setSearchHelpAdditionalText(sSearchHelpAdditionalText): sap.ui.commons.DropdownBox
Overwrite of Setter for property searchHelpAdditionalText.

Default value is empty/undefined

Parameters:
{string}sSearchHelpAdditionalText new value for property searchHelpAdditionalText
Returns:
{sap.ui.commons.DropdownBox}this to allow method chaining
setSearchHelpEnabled(bEnabled, sText, sAdditionalText, sIcon): sap.ui.commons.DropdownBox
Overwrite of Setter for property searchHelpEnabled. This method accepts additional parameter to be compatiple with the previous functionality

Default value is false

Parameters:
{boolean}bEnabled new value for property searchHelpEnabled
{string}sText new value for property searchHelpText
{string}sAdditionalText new value for property searchHelpAdditionalText
{string}sIcon new value for property searchHelpIcon
Returns:
{sap.ui.commons.DropdownBox}this to allow method chaining
setSearchHelpIcon(sSearchHelpIcon): sap.ui.commons.DropdownBox
Overwrite of Setter for property searchHelpIcon.

Default value is empty/undefined

Parameters:
{sap.ui.core.URI}sSearchHelpIcon new value for property searchHelpIcon
Returns:
{sap.ui.commons.DropdownBox}this to allow method chaining
setSearchHelpText(sSearchHelpText): sap.ui.commons.DropdownBox
Overwrite of Setter for property searchHelpText.

Default value is empty/undefined

Parameters:
{string}sSearchHelpText new value for property searchHelpText
Returns:
{sap.ui.commons.DropdownBox}this to allow method chaining