Recently I had to make a drop down menu in a Flex Application, or either ComboBox in the Flex terminology, where some of the items in it should be disabled. Many tutorials explained how to make the entire ComboBox disabled, but that was out of scope here.The idea is to have a large range, let’s say the numbers from 1 to 30, and make 1 to 10 disabled, and the others – selectable. After reading the documentation of Adobe it appears that this is not possible with just using some attribute of the default component.
Of course in the case of only three you can make it with radio buttons or checkboxes. Here after the question how to write such a component, the answer is:
Have you considered using radio buttons rather than a combo box?
Well, no, I’m not! I’d like to make it for such a big range. In my case it was more than 200 options, the case with radio buttons is not enough.
Finally I found a sample of a disabled list items on http://joshblog.net but yet again it was dealing with list, not a combo box. In my case the combo box has very important built in events and fires different kind of them in any special situation. That’s why I don’t think this sample could do the work.
Actually as it seems easy and usefull, almost nowhere there was such a component. In Adobe’s blogs I found interesting post http://blogs.adobe.com/aharui/2007/06/disabling_list_selection.html where the author describes how to make a list with that properties, and somewhere in the comments I found the component at last:
- Flex 3 Custom DateChooser
- Flex 3 text editor
- Flex 3 Custom Timeline Component
- Flex 3 DateChooser UTC issue
- Flex 3 HSlider thumb gap issue