What's so special about version 3 of Web ComboBox? As mentioned previously, there are six search modes. It's doubtful you would ever need them all, and would probably stick to one or two for consistency, but here is where this control really shines. If you have ever looked at the Gmail lookup functionality or the Google Suggest tool and drooled, now you can build the same tools into your own applications--all with a single control.
- Filter - the dropdown only appears as the user types, and returns a concise list of suggestions. Features include type-ahead and an autosizing listbox. This is the Google Suggest lookup style.
Figure 1 - Filter Mode Demo (Like Google Suggest)
Why is Filter mode special? Well, it gives most users just enough of the lookup functionality while staying out of the way. If there are only three relevant records returned from the database, the dropdown sizes perfectly to match those three. It's easy to customize the columns, text color, and highlight color too, to match the appearance of your web application.
- Classic - this is the standard paging ComboBox behaviour. The displayed list updates as the user types (as in other modes), but users can also add 'pages' to the data by clicking the paging button, or by simply scrolling down the list with the mouse or keyboard. This particular behavior is used by many comboboxes.
Figure 2 - Classic Mode (Paging ComboBox)
This mode is extremely useful if the user has a need to browse the data, or where the user is not sure which record he is looking for. If the user does not see in the current list the record he is seeking, he may just key down to the bottom of the list and increase the size of the recordset.
- Unbound - in this mode, the control is not bound to a database, but rather to an array or sorted list of items. You can even disable the textbox so that the control behaves like a listbox. This is useful if you want to maintain consistent visual appearance of your input controls.
- SmartSearch - AKA "Fuzzy search". When the user begins typing, suggestions are brought up that contain that string anywhere (not just at the beginning). The appearance of the searched-for substring is bolded. Records can be brought up in order of "importance", but this requires some configuration of your SQL statement.
Figure 3 - SmartSearch Mode (Fuzzy Substring Search)
For some developers, this feature alone will justify purchasing the control. Few other lookup components (for either desktop or web-based applications) are providing this kind of substring searching. I especially like how the substring the user is searching against is bolded in the list so he can see how that record is relevant.
One final point on SmartSearch is that it allows the developer to prioritize the returned recordset based on some metric. For example, in the case of a Customer List, you could order the list by the number of times that customer has been selected in the past (assuming that information is in the database). This is achieved through SQL, however.
- SmartList - this mode allows the user to build a list of items in an HTML textarea control. It uses the Intelligent Autocomplete (SmartSearch) feature to assist selection from a dataset, and when the user selects a value, it is automatically added to the list of items in the textarea (separated by a comma or some other character). This is similar to the feature provided by Gmail when choosing a recipient for a new message. You can select multiple email addresses, and they are all deposited in the textarea.
Figure 4 - SmartList Mode (Build lists of records in a textarea)
- Compact - just a textbox with type-ahead functionality. The neat thing about this mode is that all the same lookup capabilities are still there. You may show the list data in some other part of the page.
Figure 5 - Compact Mode
Access is provided to over 10 events, including onAfterInitialize, onShow, onHide, onBeforeSearch, onAfterSearch, onBeforeSelect, onAfterSelect, onEditKeyUp, onFocus, onBlur, and onTab.
In addition, developers can work directly with the list data, adding records, clearing the list, and even binding two comboboxes together for master-detail relationships.