Alpha Thoughts

Initial thoughts on technology, practice, and people in the IT industry
posts - 12, comments - 4, trackbacks - 1

Updated Name Picker

For a long time, my company has been using the name picker originally written by Matt White of Fynn Consulting Ltd, and updated by  by Scott Good of  Teamwork Solutions,

This has been a fantastic tool, and I am very grateful for it.  Reading its source code taught me a lot about how to make dynamic tools for the web.

As we worked with this tool, my team and I started to want new functionality including:

  • Using single categories
  • Returning more than one value from the view to separate fields on the underlying form
  • Triggering onchange events of the underlying form as appropriate

In trying to add these features, I realized that most of the code in the single value picker and the multivalue picker was the same, and that there wasn't any reason to have to update the code twice.  I bit the bullet and refactored the two pickers into a single agent (only one design element to include in databases) in which I added these new features.

Since I received the tool from the greater Notes/Domino community, it is only appropriate to give something back, by sharing the updates.

This is a preliminary version, which hasn't been hardened by real world use yet, but it has passed initial testing.  I hope folks will give it a try, and give me feedback on any bugs and suggestions for improving this tool.

Here is the feature list from the internal documentation:

Features:

* New feature:  Support multiple return fields being updated for both single-
  and multi-pickers, via  multiple values in the &returnfield and &returncol parameters.
* New feature:  Support varying multi-value separators, via the &separator parameter.
* New feature:  support for single categories within the view, via the
  &restricttocategory parameter.
* New feature:  window width and height can be set via the new &width and &height parameters.
* Trigger onchange events in fields being updated, when such events exist
* When a view is specified, user can no longer use the change NAB controls since it is probably
  an arbitrary view data picker, not a name picker. [NOTE:  future plans include a list
  of views to choose from].
* If view is empty, display "No documents in view" message instead of triggering error.
* Field names with capital letters (case sensitive) now work in Firefox

Behind the scenes:

* Consist of a single design element for simpler deployment, in this case a single agent
* Added user-friendly error messages to make developer's job easier in debugging picker usage.
* Major refactoring to eliminate multiple code points performing the same function, so that
  it is easier to add functionality; and to create a single design element for deployment.   
  In particular, single picker and multi-picker now share the same code base, HTML and CSS (with
  a more modern rendering of HTML and CSS).
* Internal improvements to some of the Javascript for more modern methods and supportability.
  For example, changing NABs no longer triggers an extra server round trip.  Replaced case-destroying
  getURLParam with a Querystring() class that preserves case.  (Firefox was sensitive to names not matching
  case.)
* Default parameters at the top of the JavaScript really are the defaults now,
  so that they can be changed once without searching the code for anyone who wants a quick
  customization path.
* Improved documentation.
* Extra cat fur in agent, courtesy of my Maine Coone.

Please, do try it and give me feedback.  I will post updates as I address any issues, and hope to have a highly stable version soon.

The code is in a sample database available in this link.  Please see the README_FIRST method in the agent for documentation.

Print | posted on Tuesday, April 22, 2008 9:34 AM | Filed Under [ Notes and Domino ]

Feedback

Gravatar

# re: Updated Name Picker

sounds great. You should add this to the web best practices wiki.
4/23/2008 11:34 AM | alan lepofsky

# Simple Method to add Name, Date, and Other Pickers to Web Forms

Simple Method to add Name, Date, and Other Pickers to Web Forms
4/25/2008 9:52 PM | Alpha Thoughts
Gravatar

# re: Updated Name Picker

Scott,

Very nice update. You've added a lot of the things I'd hoped to get around to adding to it.

Thanks!
4/30/2008 7:37 PM | Scott Good

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 3 and 7 and type the answer here:

Powered by: