Autocomplete Points of Interest
Hello All,
This is, of course, open to devs and non-devs alike for discussion :)
While working on the autocomplete plugin today, I ran across two
interesting issues that I would like to get some feedback on.
1. If a user specifies a bad url, or worse - a url on another domain,
when using a url to return 'search' results for the autocomplete's
dropdown, an exception is thrown and is uncaught. The exception just
needs to be caught/handled, not a huge deal. That does raise a
question though. What is the proper/standard method in the widget
framework/jq-ui world for handling exceptions and displaying feedback
to the user about the exception?
2. Select/ComboBox/autocomplete
(http://jqueryui.pbwiki.com/SelectComboboxAutocomplete)
(I'm speaking in general terms so that non-devs can grok, so please
forgive the use of generalities)
In Windows development, when you choose to use a ComboBox, you can set
the behavior of the control to act as a 'DropDownList', among other
properties. See
http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox_properties.aspx.
The properties which are of interest to me are; AutoCompleteMode,
AutoCompleteSource, and DropDownStyle
(http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.dropdownstyle.aspx)
DropDownStyle is inherited from
http://msdn.microsoft.com/en-us/library/system.windows.forms.comboboxstyle.aspx
The various available styles are:
Simple - Specifies that the list is always visible and that the text
portion is editable. This means that the user can enter a new value
and is not limited to selecting an existing value in the list.
DropDown - Specifies that the list is displayed by clicking the down
arrow and that the text portion is editable. This means that the user
can enter a new value and is not limited to selecting an existing
value in the list. When using this setting, the Append value of
AutoCompleteMode works the same as the SuggestAppend value. This is
the default style.
DropDownList - Specifies that the list is displayed by clicking the
down arrow and that *** the text portion is not editable ***. This
means that the user cannot enter a new value. Only values already in
the list can be selected. The list displays only if AutoCompleteMode
is Suggest or SuggestAppend.
DropDownStyle is the property which governs the behavior of the
textbox + dropdownlist for a ComboBox control. A behavior basically
'locks' the input of the control (ie. readonly="readonly") and forces
it to behave like an html select control.
This lead me to ask; Perhaps it would be appropriate to rename this
plugin 'ComboBox' and implement the autocomplete portion as a separate
plugin/utility on which the ComboBox could then depend?
The visual representations/mockups of what we would like the plugin to
eventually be able to do might also suggest that this is a good course
of action. We might also look to documentation, such as the links
provided above, for some ideas for functionality.
Please share your thoughts.