Michael Brown December 8 2009 05:30:00 PM
I recently rewrote the NAB Name Picker from the ground up, so you may want to check that new version in preference to the one detailed below. I'll leave this one in place for historical reference, however.
Unbelievably, there's still no NAB name picker for the web in Domino 8.5x; not even using xPages. Until IBM sorts that out, we're left to devise our own.
The one included here builds on the excellent work of Scott Good and Ben Duboc. All credit to Scott for coming up with the original. Their web NAB picker easily the best that I've seen, but there were a few things about it that I thought I could improve, and here they are.
First or Last Name Sorting
The original sorts by first name only. I've added a radio button to let you sort by last name too. I've also changed the info that's displayed so you get to see the full Notes Name instead of the original's first name, last name and middle name arrangement. I think this is essential for multi-domain NABs.
(Click on either image to go to a live demo.)
The original version had a fixed size; you could resize the dialog, but the data table remained fixed in size. My one is dynamically resizeable. Here's how it looks after I dragged it to a bigger size.
All this is for the multi-name version as well:
Back end - JSON & JQuery
And you get all this goodness for free. No need to change any views on your NABs. The code makes use of the "OutputFormat=JSON" parameter of the ReadViewEntries command. It was introduced in Domino 7.02, so you won't find this parameter documented in in the Designer Help for version 7. It is documented in the version 8 Designer Help though, so it's safe to use.
Once I'd decided to add a dynamic resizing feature to the dialogs, I then needed to interrogate the dialog's current size. Wouldn't you just know that Firefox and IE do this in completely different ways? Firefox uses the window.innerHeight property, whereas IE does Lord knows what. Using JQuery, I could just write:
and I was sorted for any browser.
Once I'd made that decision, I decided to use JQuery to do the Ajax calls and much of the HTML tag handling. If you don't want to use JQuery, I've left the native Ajax calls in there too. You just need to uncomment them. You're on your own resolving the browser height problem though!
Help yourself to the sample database from here:
You'll need to copy all the design elements into your own application. Namely:
- One or both of the "NAB Picker" forms, depending upon whether you require a single name or mult name picker.
- The (WebNABQO) agent
- The JQuery.js page. NB: if you already have a JQuery library in your organisation, then you won't need this. In that case, you will need to modify the HTML Header on the two "NAB Picker" forms, so that the script tag includes your own JQuery library instead of the one I've embedded in this application.
The pickerTest form gives you examples of how to call the dialogs.
- Comments