Paul Tomlin wrote:
I've built an AutoCompleteSession as part of Quick File [1] which uses the RDF mailnewsfoders datasource to allow quick selection of folders.
At the moment the session is added to the autocomplete textbox with addSession, but I'm interested in the possibility of registering a new 'datasource' such that I could set the session in the textbox searchSessions attribute.
Thus far I have found nothing of any real help to describe the process of registering a new autocomplete session, like
@mozilla.org/autocompleteSession;1?type=history
where I expect mine would be something like
@mozilla.org/autocompleteSession;1?type=mailnewsfolders
I did find one doc [2], which talks abouot registering new RDF datasources.
Is the process similar?
Not really. You have to write your session as an XPCOM component (you can write these in JavaScript, look at components/*.js for ideas), and register it using the contract id you chose above.
And there is another question that I think I need to answer before I know this is a possibility. I am displaying the nc:TreeFolderName of the folders, seperated by /'s, but the app actually needs the URI of the folder selected. I've done this in the current implementation by re-searching at the onAutoComplete stage, since there seems to be no name->value type system available.
If I was using a registered autocomplete session, is it possible to get back something other than the text the user is typing/seeing in the textbox?
'Local Folders/My Mail/Foo' -> 'local://[EMAIL PROTECTED]/My Mail/Foo'
(or similar, I don't remember the exact URI)
Not as far as I know, although I think other people have posted this as an enhancement request.
-- Warning: May contain traces of nuts. _______________________________________________ Mozilla-xpcom mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-xpcom
