Well, it only took me a year but I finally got around to writing up some documentation.
I hope to continue to improve it over time, any feedback you have is greatly appreciated.
Best,
Hillel
Well, it only took me a year but I finally got around to writing up some documentation.
I hope to continue to improve it over time, any feedback you have is greatly appreciated.
Best,
Hillel
It’s been about a year since first creating the component. I’ve been using it extensively in the applications I work on and it’s been downloaded thousands of times. At this point I’m pretty confident in saying that it works reliably.
If you’re already using the component you probably noticed that there’s now a “Latest version” link (rather than the old Demo and Download links). I’ve decided to set up a permanent page on my blog for the component. The important info (ie, the component’s license) is currently scattered amongst the past posts, this way I can keep everything together in one place.
Here’s what’s changed in this release
Thanks to e/o who’s spotted bugs, suggested improvements and just been supportive in getting the component to this state. There’s no doubt in my mind that sharing the component with the Flex community has made it far better than it otherwise would have been.
Best,
Hillel
Note: The interface for the component has been changed a fair bit in this version. If you’re upgrading, please refer to this post to determine the changes you’ll need to make.
I’ve found that I very often need to use the component as a basic autocomplete combobox, without all the extra jazz. To simplify things, I’ve split the component into two classes: AutoComplete and AdvancedAutoComplete.
I’ve moved a lot of the extra features (such as browsing and ordering) to the AdvancedAutoComplete component. The demo and documentation provide breakdowns of which features are where.
The catch with this approach is if you need one of the features from the advanced component you have to take them all. It looks like Gumbo will implement changes to the component framework which will enable implementing a better solution. I’m planning to rework the component once it’s officially released.
Additionally, I’ve changed the names of a number of properties to better follow the conventions used throughout the Flex framework.
Old Name | New Name |
---|---|
isMultiSelect | allowMultipleSelection |
multiSelectLayout | selectionLayout |
isStrict | allowNewValues (note: logic is reversed) |
areNewItemsEditable | allowEditingNewValues |
isBrowseable | showBrowseButton |
isOrderable | showOrderButtons |
styleName | selectedItemStyleName (note: now a style) |
Here’s what’s new…
Lastly, I wanted to thank Demetri for convincing me to create it, creating the icons and guiding the UI decisions along the way and Tarak for allowing me to share it (and introducing me to Flex). Thanks guys!
At this point I’m spending most of my time cleaning up the code. I started working on the component about six months ago and I find that when I look back on some of the older parts of the code I realize I’ve learned far better ways of handling things.
Here’s what’s new:
I can’t thank the community enough for the enormous amount of support I’ve received. I’ve learned a tremendous amount from the fixes people have submitted. Please keep it coming…
Thanks,
Hillel
The last version of the component had a number of major changes, as a result a couple of bugs slipped in. Thanks to e/o who posted comments documenting the issues on the blog.
Keep the feedback coming,
Hillel
If you’ve come straight to this post I’d recommend checking out the previous posts for this component for more info on using it.
Here’s what’s new:
I’ve put the codebase on Google Code. If you’re interested in getting involved in the project please let me know.
Thanks,
Hillel
If you’ve come straight to this post I’d recommend checking out the first and second posts for this component for more info on using it.
Here’s what’s new:
One last thing, I’ve added the component to the Adobe Flex Exchange. It’s a relativley new component so it doesn’t have any rating or reviews. If you’re using this component and find it useful it’d be very much appreciated if you could rate it on the site (or even better… write a review).
Thanks very much,
Hillel
First off, I just wanted to thank everyone for their comments and support. It’s really nice to know that the component is being used in other people’s applications.
If you’ve come directly to this page I’d recommend checking out the post for the original version for more info on using the component.
Here’s what’s new:
Thanks again for all the feedback
Best,
Hillel
While there are a couple of other AutoComplete components out there (most notably the ones from the Flex Team and kuwamoto.org), neither of them had the features we were looking for. I struggled for a while trying to extend them but it just wasn’t working.
One of the main features we needed was for the component to show the part of the string which matches the search term. We also needed it to support selecting multiple items as well as creating an ordered list.
As you can see in the demo, there are four main boolean properties which control how the chooser works:
Here are the other main properties:
The bare minimum required to use the component is to set the dataProvider property to an ArrayCollection of objects and specify a value for labelField.
The code for the demo is pretty straight forward.
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:hc="com.hillelcoren.components.*" width="550" height="400" initialize="init()"> <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; [Bindable] public var colors:ArrayCollection; private function init():void { colors = new ArrayCollection( [ { "name":"Almond", "hex":"#C5E17A" }, ... { "name":"Yellow Orange", "hex":"#FFAE42" } ] ); } private function handleChange():void { var color:Object = chooser.chosenItem; if (color != null) { setStyle( "backgroundColor", color.hex ); } } ]]> </mx:Script> <mx:Panel width="100%" height="100%" title="Chooser Demo" paddingBottom="20" paddingTop="20" paddingLeft="20" paddingRight="20"> <mx:HBox> <mx:VBox horizontalAlign="left"> <mx:CheckBox id="browesable" label="Browesable"/> <mx:CheckBox id="multiselect" label="Multiselect"/> <mx:CheckBox id="orderable" label="Orderable" enabled="{ multiselect.selected }"/> <mx:CheckBox id="listBuilder" label="List Builder" enabled="{ multiselect.selected }"/> </mx:VBox> <hc:Chooser id="chooser" dataProvider="{ colors }" labelField="name" prompt="Choose your favorite Crayola crayon" width="300" change="handleChange()" isBrowseable="{ browesable.selected }" isMultiSelect="{ multiselect.selected }" isOrderable="{ orderable.selected }" useListBuilder="{ listBuilder.selected }"/> </mx:HBox> </mx:Panel> </mx:Application>
I consider this to be a version 0.9. It seems to work pretty well but I’m sure there’s a bug or two hiding in there. There are also a couple of more features I’d like to implement.
There’s no copyright… please use the code freely. I just ask that if you come up with any improvements you email them back to me.
Hope you find this component useful,
Hillel