Question

Environment: Flex/As3/Cairgorm/composite component. I have two comboboxes and two datagrids such that the selection of combobox 1, inserts data into combobox two and the fist datagrid. The selection of combobox 2 inserts data into datagrid 2.

I have setup the change event so that the user selection on each of the combo boxes do the right thing. The problem is that on the initial load of the comboboxes, the change event does not fire and subsequent synchronization data loading does not happen.

Is there an event for getting the itemselected (1st item) after the combobox is initialized?

Was it helpful?

Solution

I found my own answer. Using the updateComplete event on each of the comboboxes did the trick.

[EDIT]

It turns out that updateComplete did not work as expected. What I really needed is the dataChange event. However, it appears that this event does not fire for comboboxes even though it is listed as a valid FlexEvent for this component.

I tried a number of other events (valueCommit, creationComplete, initialize) but all of these fire multiple times, overlap with change, and are not useful for this usecase.

In the end, I created a gludge of a chain of calls for the initialize path and change path.

If anyone else has a better way, I'd be very interested.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top