0
votes

I've been looking at Adobe's documentation for the spark ComboBox, but I'm not able to find the method:

setSelectedIndex(value:int, dispatchChangeEvent:Boolean = false, changeCaret:Boolean = true):void

I know this function exists, because my code uses it. I'm using Flex sdk 4.14.1. When I go to the ComboBox.as source file, I find the function well and good:

/**
 *  @copy spark.components.supportClasses.ListBase#setSelectedIndex()
 *  
 *  @langversion 3.0
 *  @playerversion Flash 11.1
 *  @playerversion AIR 3.4
 *  @productversion Flex 4.10
 */
override public function setSelectedIndex(value:int, dispatchChangeEvent:Boolean = false, changeCaret:Boolean = true):void
{
    // It is possible that the label display changed but the selection didn't.  If this is
    // the case, the label has to be updated since the setSelectedIndex code will short-circuit
    // and not commit the selection.
    // An example is if the label is deleted and then the first item is chosen from the
    // dropdown, the selectedIndex is still 0.
    if (userTypedIntoText && value == selectedIndex)
        updateLabelDisplay();

    super.setSelectedIndex(value, dispatchChangeEvent, changeCaret);
}

I also went up the inheritance tree (DropDownListBase -> List -> ListBase etc) and none of the classes that ComboBox inherits from have documentation on setSelectedIndex.

The only documentation I could find was an old version (Flex 4.10) saved on ZengRong's blog.

Is the method setSelectedIndex still supported? Is there anywhere else I could look for documentation?

1

1 Answers

0
votes

That version of Flex is from the open-source Apache version, Adobe no longer maintains/develops Flex:

http://flex.apache.org/asdoc/spark/components/ComboBox.html

setSelectedIndex () method

override public function setSelectedIndex(value:int, dispatchChangeEvent:Boolean = false, changeCaret:Boolean = true):void

The rowIndex is the index in the data provider of the item containing the selected cell.

Parameters

value:int — The 0-based row index of the cell.

dispatchChangeEvent:Boolean (default = false) — if true, the component will dispatch a "change" event if the rowIndex has changed. Otherwise, it will dispatch a "valueCommit" event.

changeCaret:Boolean (default = true) — if true, the caret will be set to the selectedIndex as a side-effect of calling this method. If false, caretIndex won't change.

Main entry point of ASDOC for Apache Flex