This post describes briefly an implementation of Scriptaculous’ Ajax.Autocompleter class.
It uses an AJAX request using a Page element for an @DBLookup I believe first mentioned at Lotusphere 2007 by Jack Rattcliff and later (?) by Jake Howlett in his http://www.codestore.net/store.nsf/unid/BLOG-20060221 and perfectionized (?) by my collegue Tomas.
Scriptaculous autocompleter needs an unordered list in return. For instance this list might be returned after the user typed the letter “y”:
<ul>
<li>your mom</li>
<li>yodel</li>
</ul>
Some examples use an agent to return the unordered list, others describe using a page.
The demo allows you to fill in multiple fields after clicking on one of the presented suggestions by splitting the responseText:
In demo-mode it would look something like this:
For downloading a working example click here.
The nsf seems to be encrypted and can’t be opened..no problem with a few of your other ones.
Btw.. Just came across your site recently. Nice stuff for those doing mostly Notes devs and shifting some stuff to web based apps. Thanks..
Hi Stephen
I thought I especially set the option ‘do not locally encrypt this database’. I am having some problems with my Notes 8 client which seems to want to locally encrypt every DB by default (thanks IBM for creating a jungle of client settings) so hopefully the problem is related to different clients? (I checked the db on my client and it has no local encryption it says…)
I get the encryption problem as well, I’m using R8. Thanks Phil.
i created a new download, i hope this one works better ?
I’ve managed to open the app now – thanks, but the AJAX type-ahead doesn’t seem to work, I’m using R8 server, IE7
Thanks again – Phil.
Hi Phil, I run IE6 myself… do you type in a value that is ON the documents?
here I have no problem with the type ahead… sowwy!
Thanks. It’s now working in both Firefox 2.x and IE 6.x and I’m using Notes 8.
It worked for me, and I even managed to apply it on my database. My question now is how do I put the value of a form field to the parameter “lookupprefix”? If I hardcode a value to “lookupprefix”, it worked. But when I tried to use $(‘fieldname’).getValue, it doesn’t work. Any suggestions?
I’m trying to populate a 2nd field based on the 1st field. I’m trying to get the value from the 1st field and put it in the lookupprefix, so that the options inside the 2nd field would only show those related to the 1st field. Using $F(‘fieldname’) doesn’t work either. But when I alert $F(‘fieldname’), it shows the value.
document.forms[0].fieldname.value also doesn’t work.
But when I hardcode a value in lookupprefix, it works.
How do I put value in lookupprefix that is not hardcoded, that is based on a field? Thanks.
@Phil, the problem lies with IE7. I need to look for a fix…
here is the bug fix:
in the HTML Head Section a variable for the URI is defined like this:
var appURI = ‘//” + SERVER_NAME + “/” + @WebDbName + “‘” + @NewLine
this should be
var appURI = ‘http://” + SERVER_NAME + “/” + @WebDbName + “‘” + @NewLine
in order to have it working correctly in IE7, sorry for teh inconvenience…
This nsf doesn’t work for me..I am using R7.0.3 & IE 7 and i fixed the line you mentioned above.
thanks in advance
Rajni
Excellent, thanks. Works great on R8.01 client and Firefox 3.
(Hate the download site though, with all the popups, flashpasts, pretend buttons that are actually adverts. Please reconsider using a more professional site, though err…umm.. I can’t think of any at the moment … ah yes http://www.megaupload.com/ )