简体   繁体   中英

Flex combobox drop down halted when i select one item and show alert

Here is my code. I run this code on change event.

for(var i:uint =0; i< model.medicalHistoryDTOListByPatient.length; i++)
                    {
                        if(formatDateTime.format(model.medicalHistoryDTOListByPatient[i].VisitDate) == formatDateTime.format(id_VisitDatesCombo.selectedItem.VisitDate) )
                        {
                            Alert.show('Record already exsist against this Visit', 'Please select another date ');
                            id_HistoryView.enabled = false;
                            break;
                        }else{
                            if(model.CHistoryAssociatedVisit != null)
                            {
                                model.CHistoryAssociatedVisit.VisitDate = id_VisitDatesCombo.selectedItem.VisitDate;
                                model.CHistoryAssociatedVisit.ID        = id_VisitDatesCombo.selectedItem.VisitId;
                            }
                        }

                    }

When if condition is matched and alert is popup then drop down still open and alert is shown.

How i close dropdownlist when i select one of item from Drop-down ?

Use dropDownList.closeDropDown() to manually force the drop down list to close. This should also work for the Flex Spark ComboBox.

The MX ComboBox has a close method you can use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM