Drop-Down

Deprecation Warning! The content below is only applicable for use within deprecated 1.x versions of CA Agile Central's App SDK. Use of the component(s) and/or code on this page is not supported. To develop custom apps within our current environments, please see App SDK 2.0 documentation.

The drop-down component provides an easy way to display data in a drop-down list.

Set the selected item of the drop-down based on the specified display value.

dropdown.setDisplayedValue("Selection 1");

setValue

value*

Set the selected item of the drop-down based on the specified value.

dropdown.setValue("1");

setComponentValue

value*

Same as setValue.
Provides a consistent interface for setting the value of basic components.

dropdown.setComponentValue("1");

destroy

-

Removes this component.

dropdown.destroy();

* = required parameter

Events

Events are used to notify consumers of a component when actions occur. The following methods are provided in order to interact with this component's events:

Method

Parameters

Description

Example

addEventListener

eventName*, listener*, scope

Registers the specified listener with the component's queue for the specified event and returns an object which can be used to remove the event listener later. The listener parameter should be a function with two parameters: 1) the component that fired the event; 2) an eventArgs object with properties specific to the event being fired. This function will be called by the component when the event occurs. If the optional scope parameter was specified the function will be called on that object (such as scope.listener(sender, args);).

Returns an object with a property for each event name supported by the component. This is useful for passing as the first parameter to addEventListener().

var eventName = component.getValidEvents().onClick;

* = required parameter

The drop-down component supports the following events:

Event Name

Description

Event Arguments

Example

onChange

Fired when a new value is selected

The eventArgs object passed to any event listeners
contains the following properties:

value: Returns the underlying value for the drop-downs current selection.displayedValue: Returns the underlying displayed text for the drop-downs current selection.item: Returns the object value that was used for the current selection.

dropdown.addEventListener("onChange", onChangeEventListener);

onLoad

Fired when the component is loaded

The eventArgs object passed to any event listeners
contains the following properties:

value: Returns the underlying value for the drop-downs current selection.displayedValue: Returns the underlying displayed text for the drop-downs current selection.items: Returns all the items used to display this component.item: Returns the object value that was used for the current selection.