Friday, August 11th, 2006
Improved Dojo ComboBox
<>p>One of the joys of Ajax is watching a bunch of competing toolkits once again implement the same old widgets we’ve been using since the nineties. On this subject, Kenneth Ko writes:The main problem I see with the dojo ComboBox control is that it is
NOT a true ComboBox. It is an AutoCompleter. A ComboBox should really
exhibit these behaviours:* When typing in the textbox, a comboBox should MOVE to the item, not
filter the search results.* You should be able to select any item in the list using only the
mouse (e.g. selecting “Wyoming”).* In a ComboBox, you should be able to select an item which doesn’t
match what you type. For example, you should be able to type “H”
(which selects “Hawaii”) then press down to select “Idaho”.* Have the ability to page through large result sets.
Kenneth was kind enough to modify Dojo’s comboboxy-autocompleter widget to become closer to the one true combobox metaphor we’ve come to know and love:

My favorite is the WinXP down-arrow widget combined with the OS X scrollbar when viewed on my Mac. ;-)
Related Content:











A really good degradable combobox would be fantastic for developers and users. It still amazes me to this day that browsers don’t support it. It would be waaay easier for them to make a <select name=”foo” combo=”combo”>…</select> than for us to use javascript to jury-rig our own…
I don’t mean to disappoint but what we have above was implemented in Dojo a while ago; it’s called Select, i.e.:
and was added because there are a number of different opinions about what a ComboBox really is…the original Dojo ComboBox tried to be both an autocompleter and a select widget, but by splitting them into two separate widgets you can have one or the other.
And you guys *really* need to fix your comment posting system, every time I comment I get pushed to a blank page, and I believe that 1. its been that way for quite some time, and 2. you’ve heard lots of complaints about it already…
Really it should be an ajax comment system where the comment appears automatically w/o any page redirect / refresh.
Should be easy right?
RE: Comment system, general site problems: Yup, the site needs some tender lovin’ care. It’s certainly something we want to resolve. Where does the time go?
RE: Dojo Select vs. ComboBox widget. I think you missed the point Tom — the Select widget still reduces the set of items in the dropdown instead of behaving like a “normal” combobox and highlighting the appropriate line. At least, the last working version of the Select widget I found works like this. The current nightly version is broken. Kenneth’s version works like a normal combo box in that it selects the value but doesn’t eliminate the other values in the popup.
“And you guys *really* need to fix your comment posting system”
Here, here – it really needs to be sorted – for a site that talks so much about the web abd about accessibility, it’s a joke that they can’t get something so simple to work properly; for Chrissake, even MSN can get that much right! Come on Ajaxian, get your finger out of your ….. and fix it!
“RE: Dojo Select vs. ComboBox widget. I think you missed the point Tom — the Select widget still reduces the set of items in the dropdown instead of behaving like a “normal†combobox and highlighting the appropriate line. At least, the last working version of the Select widget I found works like this. The current nightly version is broken. Kenneth’s version works like a normal combo box in that it selects the value but doesn’t eliminate the other values in the popup.”
Really. That’s not right :( There’s been a lot of work going on surrounding those widgets (the popup portion in particular) but the select widget was supposed to behave like a select widget, iirc. I’ll look into it.
Tom,
Thanks for pointing me out to the dojo select control, can’t wait to see it when the nightly is back in action.
I’ve read the comments on the select widget blog , and Patrick Heymans has some good points regarding the way a combo widget works. As an example, the EBA JSF project now has a comboBox here . It highlights items you type in, rather than filtering it. Also, it has the ability to display items incrementally, and i think it’s smart in that it only gets the new items without wiping the old items. Caching already retreived items locally would also be an idea.
Regarding whether a ComboBox should allow new items to be added, I thought that was more of a server-side issue. In my .NET control, during a PostBack, it stores the user-typed text in order to maintain state across postbacks. It could easily be modified to store new items to the list.
Would love to contribute to the project, contact me if you would like a hand. cheers.
It lacks a bit of accesibility by adding that fade in effect for the pulldown. I am constantly tempted to double click it to see something instead of getting instant feedback of my click. Another one is that these AJAX apps are spending a lot of time consuming my CPU loading lots of libs, like digg.com does.
and in the end, it’s kind of useless for the the day-by-day app, perhaps it would get some enterprise use in the intranets but giving that this is a hybrid, it would need special training for “Megan from the Solitaire/Freecell department”.
Hi,
Where can I get the source for the design template???
This was the control I was searching for long long time
I got to know how to intergrate the control but is hanging for huge list….
how do we get the length i.e no. of elements in the combobox – is there a property or how do we create properties
can i get source code /widget/template for this plsssss
thnx