Domino Name Picker Revisited [ROUGH CUT]
Out of necessity, I recently revisited a common requirement of Domino browser-based applications — "Name Pickers".
I needed a name picker for a project I was working on. After looking through the various solutions available I couldn't find one I felt comfortable using, so I decided to write my own.
What I tried to move away from is the adopted convention that a Name Picker must, for some reason, be a popup window. I've also done away with the notion of a textarea being a suitable place to visually render the chosen list of names. It's all very well giving the user a nice to way to add names, but what about when they want to remove them? Both are equally important tasks. Do they have to carefully select the name in the field and delete it manually? Instead of a field I've used a table with a delete link. The field itself is hidden.
The Problem
Domino has always been based around its central directory. Generally speaking, this address book contains all the names of people within the organisation concerned. Most applications within the organisation need a way for users to select names from this list. In the Notes client it looks like this:

When Domino came about and Lotus ported their templates to the browsers they came up with a way of mimicking this feature in the browser. The trouble is they tried too hard to mimic it and didn's stop to think whether it really should be exactly the same. The result looked something like this:
Ugly init.
Popup=bad?
The Solution
Avoiding popups I decided to try and bring the idea uptodate with a more DHTML Web-2y look and feel. In the form below there's a names field. Next to it is a people icon. Clicking on this brings up the yellow "dialog" you can see. Typing in a name fetches matches entries from the (configured) Address Book. Clicking on a name returned adds it to the list.
Note the lack of popups and page refreshes. It's all done using Ajax. Something users are growing accustomed to. No room now for ugly time-consuming methods. Got to be fast and funky.
The Code
The actual code used isn't what we're interested in here. If you curious how it works behind the scenes you can always take a look for yourself. All I want to talk about here is how to implement this solution to your applications.
First thing you'll need is to download NamePick.nsf from this article. Now copy the following design elements in to your target database:
| Element Type | Element Name |
| Page | css/namepick.css |
| Subforms | NamePicker |
| Script Library | js/NamePicker.js |
| Images | images/*.* |
| File Resource | lib/prototype.js & util/effects.js |
Now open the Form you want to use a name picker in. Somewhere on it, insert the NamePicker subform. Now, in the form's HTML Head Contents add references to all the required files, so that the HTML ends up looking like this:
<script type="text/javascript" src="lib/prototype.js"></script>
<script type="text/javascript" src="util/effects.js"></script>
<style type="text/css" media="all">@import url(css/NamePick.css);</style>
<script type="text/javascript" src="js/NamePicker.js"></script>
You now have everything you need to get it working. Next step is to make configuration changes. To do this, open the NamePicker subform, which looks like this:

For most cases you can leave it the same. Making changes should be obvious.
All you need to do now is add a little icon next to your names field to call the dialog. Easiest way to see how is open the "Demo" form. Icon links look like this:

The important part is the call to NamePicker.open() in the onclick event. This could of course equally well be the onclick event of a button or any HTML element for that matter. The bit you need to worry about is the third argument, which is the name of the field you want to pass values back to. The fourth option is the type of name selection - single, multi or table, each of which you can see in action in the Demo form.
Version 1.5
Updated 6/3/07: The App is now at v1.5, which means:
- Uses most up-to-date "protaculous" libraries.
- List of returned names uses a list instead of a table.
- Works with either XML or JSON (config option {OutputFormat:'JSON'})
- Code tidy up, Use DOM builder methods instead of creating strings.
- Demo points to 40,000 entries in fakenames.nsf
Enjoy. More to come...
Feedback:
Domino Name Picker Revisited 
. .
Don't forget your IFrame shim.. (Jeff Crossett, Mon 26 Jun 2006)
. . . .
Re: Don't forget your IFrame shim.. (Jake Howlett, Tue 27 Jun 2006)
. . . . . .
Re: Don't forget your IFrame shim.. (Jeff Crossett, Tue 27 Jun 2006)
. . . . . . . .
Re: Don't forget your IFrame shim.. (Julian Robichaux, Tue 27 Jun 2006)
. . . . . . . . . .
Re: Don't forget your IFrame shim.. (Julian Robichaux, Tue 27 Jun 2006)
. .
Alternative to DbLookup? (Wayne MacKirdy, Tue 27 Jun 2006)
. .
Error in HTML Head code (Chris Bellamy, Thu 6 Jul 2006)
. . . .
Re: Error in HTML Head code (Jake Howlett, Thu 6 Jul 2006)
. . . . . .
Re: Error in HTML Head code (Michael, Thu 6 Jul 2006)
. . . . . . . .
Re: Error in HTML Head code (Jake Howlett, Thu 6 Jul 2006)
. .
R5 deployment (Jakes Becker, Tue 11 Jul 2006)
. . . .
Re: R5 deployment (Jake Howlett, Tue 11 Jul 2006)
. . . . . .
Re: R5 deployment (Jakes Becker, Tue 11 Jul 2006)
. . . . . . . .
Re: R5 deployment (Jake Howlett, Tue 11 Jul 2006)
. . . . . . . . . .
Re: R5 deployment (Jakes Becker, Wed 12 Jul 2006)
. . . .
Re: R5 deployment (Leo Dai, Wed 12 Jul 2006)
. . . . . .
Re: R5 deployment (Jakes Becker, Wed 12 Jul 2006)
. .
Scroll bar not visible (Leo Dai, Wed 12 Jul 2006)
. . . .
Re: Scroll bar not visible (Jake Howlett, Wed 12 Jul 2006)
. . . . . .
JSON Not working (KV, Thu 15 Mar 2007)
. . . . . . . .
Re: JSON Not working (Tony Zhang, Fri 23 Mar 2007)
. . . . . .
No "MC" Hammer (Stan B., Fri 1 Feb 2008)
. .
Focus (Paul Conroy, Fri 14 Jul 2006)
. . . .
Re: Focus (Jake Howlett, Sat 15 Jul 2006)
. .
Mozilla problem (David, Mon 17 Jul 2006)
. . . .
Re: Mozilla problem (Jake Howlett, Mon 17 Jul 2006)
. . . . . .
Re: Mozilla problem (David, Mon 17 Jul 2006)
. . . . . . . .
Re: Mozilla problem (Jake Howlett, Tue 18 Jul 2006)
. .
NamePicker settings (jay, Fri 21 Jul 2006)
. . . .
Re: NamePicker settings & changing speeds (Steve, Wed 26 Jul 2006)
. . . . . .
Re: NamePicker settings & changing speeds (Jake Howlett, Wed 26 Jul 2006)
. . . . . . . .
Re: NamePicker settings & changing speeds (Steve, Fri 28 Jul 2006)
. .
Notes Client. (Anthony Miller, Thu 3 Aug 2006)
. . . .
Re: Notes Client. (Jake Howlett, Thu 3 Aug 2006)
. . . . . .
problems with implement this solutuin (Linda, Thu 10 Aug 2006)
. . . . . . . .
Re: problems with implement this solutuin (Jake Howlett, Wed 16 Aug 2006)
. . . . . . . . . .
problems with implementing this solutuin (Mark Holloway, Tue 24 Apr 2007)
. . . . . . . . . . . .
Problems implementing this solutution (Mark Holloway, Tue 24 Apr 2007)
. . . . . . . . . . . . . .
Re: Problems implementing this solutution (Mark Holloway, Tue 24 Apr 2007)
. . . . . . . . . . . . . .
HELP Re: Problems implementing this solutution (tabjosh, Thu 17 May 2007)
. . . . . .
Re: Notes Client. (Anthony Miller, Wed 30 Aug 2006)
. .
Name picker problem (Srini, Sun 20 Aug 2006)
. . . .
Re: Name picker problem (Jake Howlett, Mon 21 Aug 2006)
. . . . . .
Re: Name picker problem (Srini, Tue 22 Aug 2006)
. . . . . . . .
Re: Name picker problem (Andreas, Wed 23 Aug 2006)
. .
I have a name picker here that works ok (Jason, Sat 26 Aug 2006)
. . . .
server has been down for long time (Jason, Sun 27 Aug 2006)
. .
Does not work with large Domino Directory (Panu Haaramo, Fri 1 Sep 2006)
. . . .
Now it works on a different server (Panu Haaramo, Mon 4 Sep 2006)
. .
Use within login page (Andrea Brunelli, Tue 5 Sep 2006)
. . . .
Re: Use within login page (Jake Howlett, Tue 5 Sep 2006)
. . . . . .
Re: Use within login page (Andrea Brunelli, Tue 5 Sep 2006)
. . . . . . . .
Re: Use within login page (Jake Howlett, Tue 5 Sep 2006)
. . . . . . . . . .
Re: Use within login page (Andrea Brunelli, Tue 5 Sep 2006)
. . . . . . . . . . . .
Re: Use within login page (tw, Sat 30 Sep 2006)
. . . . . . . .
HELP - Use within login page (tabjosh, Thu 17 May 2007)
. .
Very nice... (John Turnbow, Tue 26 Sep 2006)
. . . .
Thanks so much! (Marcus Laubli, Mon 6 Nov 2006)
. .
LotusNotes (pratima, Wed 22 Nov 2006)
. .
JSON Not working (KV, Thu 15 Mar 2007)
. . . .
Re: JSON Not working (Tony Zhang, Sat 24 Mar 2007)
. .
Return value (TomW, Thu 3 May 2007)
. . . .
Populate additional fields... (Stan Brown, Thu 24 Jan 2008)
. . . . . .
Re: Populate additional fields... (Jake Howlett, Thu 24 Jan 2008)
. .
V 1.5 not looking up names (Nick Malone, Tue 19 Jun 2007)
. . . .
Re: V 1.5 not looking up names (Jake Howlett, Tue 19 Jun 2007)
. . . . . .
Re: V 1.5 not looking up names (Nick Malone, Tue 19 Jun 2007)
. . . . . .
Re: V 1.5 not looking up names (Nick Malone, Tue 19 Jun 2007)
. . . . . . . .
Re: V 1.5 not looking up names (Nick Malone, Tue 19 Jun 2007)
. . . . . . . .
Re: V 1.5 not looking up names (Marc de Kleijn, Mon 27 Aug 2007)
. .
v 1.5 error in read mode (Nick Malone, Wed 20 Jun 2007)
. . . .
Re: v 1.5 error in read mode (Jake Howlett, Thu 21 Jun 2007)
. .
Slight Problem with IE6 (Patrick, Tue 26 Jun 2007)
. .
Works fine in HTTPS mode but fails in HTTP mode (KV, Fri 6 Jul 2007)
. .
Problem in modal dialog (Chris, Wed 18 Jul 2007)
. . . .
Re: Problem in modal dialog (Chris, Thu 19 Jul 2007)
. .
V1.5 not looking names (Alam, Wed 5 Sep 2007)
. .
Use for other datasources on same form (Chris, Thu 6 Sep 2007)
. .
What about Swedish language support? (Patrick Kwinten, Wed 10 Oct 2007)
. . . .
Re: What about Swedish language support? (Mads Birk, Tue 13 Nov 2007)
. .
IE z-index workaround? (Patrick Kwinten, Wed 10 Oct 2007)
. .
Categorized Views? (Charlie, Tue 16 Oct 2007)
. . . .
Re: Categorized Views? (martin meijer, Tue 30 Oct 2007)
. .
Problem with both versions (David, Wed 14 Nov 2007)
. . . .
Re: Problem with both versions (Jake Howlett, Thu 15 Nov 2007)
. . . . . .
Re: Problem with both versions (David, Thu 15 Nov 2007)
. .
IE7 (Philippe Perrier-Faucher, Wed 28 Nov 2007)
. . . .
Re: IE7 (Jake Howlett, Thu 29 Nov 2007)
. . . . . .
Re: IE7 (Philippe Perrier-Faucher, Wed 16 Jan 2008)
. .
Thanks.... Very Much. (Saadettin, Mon 24 Dec 2007)
. .
Problem with Name Picker (Anne Murali, Sun 30 Dec 2007)
. .
multiple directories (Marc de Kleijn, Thu 3 Jan 2008)
. . . .
Multiple Fields (Stan, Thu 31 Jan 2008)
. .
Move Dialog Box with Scroll or Window Resize (Lenni Sauve, Fri 18 Jan 2008)
. . . .
Re: Move Dialog Box with Scroll or Window Resize (Lenni Sauve, Fri 18 Jan 2008)
. .
Populating more than one field (Stan, Thu 31 Jan 2008)
. . . .
Re: Populating more than one field (Stan B., Thu 31 Jan 2008)
. .
How about filtering? Groups? (Thomas Reich, Tue 4 Mar 2008)
. . . .
Re: How about filtering? Groups? (Jake Howlett, Tue 4 Mar 2008)
Add your response here: