Tony wrote:
Is it possible to use an autocomplete textbox with a custom datasource, ie NOT just history, addrbook, ldap, urlbar?
It depends on what you mean by a datasource. An autocomplete textbox
expects to be provided with an object called an autocomplete session.
The only builtin versions are the history, addrbook and ldap sessions
you mention, but this object could be implemented as a JavaScript object.
This question has been asked before, but there is never an answer. I have tried several sources of documentation but none of them actually says one way or the other whether custom data sources are supported. There is always a hint that they "could" be possible.
I expect nobody's been sufficiently motivated to try before.
My reading of the situation is that people would like to be able to use custom datasources and that there is an existing framework into which such a data source could be placed, but that as yet no one has come up with any way of doing this without having to know far more that a XUL application programmer has the slightest chance of understanding.
Well, I don't think it's that much more complex than writing a custom
tree view. The methods that your object actually provides are given in
nsIAutoCompleteSession.idl but it will need to "return" an object that
provides the nsIAutoCompleteResults.idl methods. Although in theory this
object requires the use of nsISupportsArray, in Mozilla it is only
called from autocomplete.xml so you could emulate that too;
unfortunately FireFox uses a C++ autocomplete controller, so you would
have to create a real nsISupportsArray. And finally, autocomplete
textboxes currently only work in chrome; Mozilla ones could be fixed to
work in content.
--
Warning: May contain traces of nuts.
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom