Neil <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> 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.
> 

I've got thus far in my research:-

var contractid = "@mozilla.org/autocomplete
Session;1?type=my_datasource";
var session = Components.classes[contractid].getService(components.
                       interfaces.nsIAutoCompleteSession);

But where and what would my_datasource be?  Please excuse me no
knowing all about this, I am still trying to learn it.

I have looked at both nsIAutoCompleteSession.idl and
nsIAutoCompleteResults.idl on the Mozilla LXR, but I don't know how to
go forward from there ...

> 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.

I really appreciate you taking the time to set this out but, I'm
sorry, you've lost me.

> 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; 

still lost ...

> 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.

(heavy breathing) sounds like bad news but maybe not too bad ...

If you have the inclination I would be grateful if you could pick me
up where I got lost and get me going again or point me to somewhere
that has a fairly easy explanation.
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to