Monday, November 15, 2004

Room for orderly dialog

There have been a couple of folks asking around about Notes articles. "When's the next article?" "Why haven't I seen any tech articles on your blog lately?" "Why are you not writing an article now?" "What's up, dude? Out of ideas? Are you just a one-trick pony? Do you only do calendars?" Well, I guess it's time we had an orderly dialog or two.

Every once in a while, you run across an application where you need things to appear in a particular order. I'm not talking about sorting — there are a thousand variations of sorting algorithms for LS out there, and Java has sorting methods built-in. Even Formula Language has a wonderfully fast and efficient @Sort now, thanks to Damien. No, I'm talking about creating an arbitrary order in a list, and making that list easily maintained by the user.

One of the first things that people bang their head against in Notes is the fact that the choice list for keyword-type fields is not programmatically accessible at run time. Anyone used to creating UIs in, say, Visual Basic will have become accustomed to being able to manipulate the contents of a listbox, and then using the entire content of that listbox elsewhere in the program. We Notes types take it for granted that this can't be done directly. Fortunately, the word "directly" gives us an escape route. There may be work-arounds involved, but we don't need to offer second-class UIs to our users.

Over the next few entries, I'm going to take a look at two variations on that theme. One is a simple single-list dialog that will allow the user to add and remove entries and shuffle the order of entries without having to cut 'n' paste or re-type. The second is a dual-list version that allows the user to select options from a source list, add them to (or remove them from) a second list, and put the result into any desired order. There will be two versions of each, one for the Notes client and one for the web. Once the series is complete, I will add the dialogs to OpenNTF.org's Code Bin (for those who are either too busy to cut 'n' paste or who want to see the full-featured versions, since some features will not be covered here for brevity — I'm long-winded enough already).

The Notes versions are interesting in that the entire dialog is driven by Formula Language. Oh, sure, the dialogs will be called by LotusScript, but that's only to create a temporary document so that you don't add a bunch of useless fields to the target document or worry about the field names on the dialog form. All you need to do is modify the calling script to suit the application.

I hope this satisfies the vultures for a little while. I know that the rest of you would be much happier reading about the life of a tête-carré in Montréal, so there will be some discussion of smoked meat, poutine, real bagels and the meaning of the "RC" button in the elevators between installations.

No comments: