Name Picker

One of the things which has bugged me for a long time is getting a good name picker. We have been using a servlet on our Domino server for a long time which looks at views in the NAB and allows the user to select individual names to be added to a document in a web browser. Alas the servlet is showing its age and with the advent of AJAX it is about time that we came up with something better.

So the requirements:

  • A generic popup window which allows a user to select one or many values from a very large view (100,000 documents plus)
  • It has to perform well
  • It has to be cross browser compatable (at least IE and Firefox)
  • It has to be easily re-usable

    I have put up a demo page which looks at a view in my sister site – 50WordReview.com, over the next few days I’ll put up an explanation of how it works and some of the tricks which I have used.

    Update: I have added a couple of articles which will hopefull be useful. How to use the name picker and how the picker works.

  • Join the Conversation

    19 Comments

    1. Thanks for the comments guys. Glad you like it.

      Bruce, the bug is very strange, I am just setting the value of the text field, but it is not displaying. If I uput an alert after setting the value then it seems to have been set correctly but nothing is showing up. I will try and fix it when I have a spare half hour.

      Matt

      Like

    2. The name picker is a wonderful tool. The multi-name picker seems to work in both IE and Netscape 7. However, I can’t get the single name picker to work in Netscape 7. It appears that the window.opener.document.getElementById function is not returning the object in Netscape. Of course, it works fine in IE. Any ideas?

      Like

    3. I discovered the problem with Netscape 7. Actually, the first problem I asked about (window.opener.document.getElementById not returning an object) wasn’t a problem per se. It seems Netscape 7 needs the id parameter (instead of name) to be used in order for the getElementById method to work. I changed name to id and both IE and Netscape were happy. The next problem I ran into was getting the value to appear in the text field. Initially, I thought Netscape wasn’t returning anything(sounds like Matt White was having a similar problem). Then I discovered that it was returning the desired value preceeded by spaces(Matt try pressing the down arrow to scroll the text to the top…I knew something was there because I returned the value in an alert popup). It turns out there is a little bug in the way Netscape handles the unescape function (unfortunately, it took me a couple of days to figure this out…decodeURI offered the same results). It took me a couple of days but I have it working now.

      Like

    4. I want to thank Matt White, Scott Good, and the community for this wonderful name picker, from which I have learned a great deal, and which has served my organization so well that we started wanting to have new features added to it…I have reworked it into a single design element, and added several new features including:- Support for single categories- Support for multiple return values into differing fields- Triggering onchange events on the underyling formI want to give something back to the Notes community which has given me so much, so I have posted this on my (still nacent) blog in the post { http://alpha.jenkinsmd.com/archive/2008/04/22/10.aspx“ rel=”nofollow” target =”blank”>Link }I hope everyone will take a look, help me identify any bugs, and give me feedback for improving it.—Scott Jenkins

      Like

    Leave a comment