Disclaimer and License

Opinions expressed here by Tim Tripcony are his own and not representative of his employer.

Creative Commons License
Tip of the Iceberg is licensed under a Creative Commons Attribution 3.0 Unported License.
Based on a work at timtripcony.com.

Unless otherwise explicitly specified, all code samples and downloads are copyright Tim Tripcony and licensed under Apache License 2.0.

Search

What the Quote?

"Your trachea is your windpipe, not your Coke pipe."

Tim Tripcony

"That's gonna pop into my head in the middle of some meeting... I'll spray Gatorade all over the projector, and run to the restroom, hoping to not piss my chinos."

Tim Tripcony

"Gentle, sweetie. Don't eat Daddy's leg. Good girl."

Tim Tripcony

« two voices worth listening to | Main| may you live in interesting times »

demo application from the recent X-Series webinar

Category xpages
Two weeks ago I participated in the latest X-Series webinar sponsored by GBS and TLCC. You can watch the replay of that webinar here.

Prior to the Q&A panel, each of the panelists gave a brief presentation about specific topics related to XPage application development. The topic of my presentation was "creating flexible user interface features using Repeat Controls". If you've done much development with XPages, you've likely already used Repeat Controls at least occasionally, but my goal was to demonstrate that, when we eschew some of the more obvious controls IBM has provided us for representation of data collections (such as the View Panel and Data Table), the comparatively blank canvas of a Repeat sets us free to provide any data representation we (and, hopefully, our users) want. In many cases, the additional development effort required is still minimal, but what we get in return is the freedom to go beyond the tabular grid representation we've been giving users since 1989 and allow them to interact with precisely the same data, but in ways that more closely resemble the modern interfaces they're accustomed to experiencing in other computing contexts.

You can browse the demo application I used to provide just a few examples of this premise, or download it to peruse the actual code.

The final example that this demo app contains is an illustration of the pattern I've taken to calling "infinite form". Every Notes developer has at least inherited, if not created, at least one app containing a form that included a notion of "line items"... this pattern is common within business objects such as expense reports, purchase requisitions, and the like. Originally, this pattern was typically implemented in Notes forms by creating a "field grid": a table with one column for each data point that must be recorded for each line item (e.g. unit price, quantity, description, etc.), and a row for each line item. The end result, then, was fields named something like UnitPrice_1, UnitPrice_2... UnitPrice_50, and so on. This, of course, was difficult to maintain. Either we had to create a ridiculous amount of hide-when formulae to suppress disclosure of unnecessary rows until the user requested more, or simply show them all the fields whether they needed them or not. And, predictably, the users would eventually need more rows than the form contained, so we'd find ourselves adding 50 more fields and 50 more hide-whens to the form.

With the advent of embedded views, it became common to create a pseudo-relational structure by treating each line item as a separate response document displayed within an embedded view inside the parent document. In some ways, this pattern was far more maintainable, because we no longer had to care how many line items might be needed. But it presented new challenges: sometimes the responses needed to be updated when the parent document changed; in order to allow removal of line items, either the users must be granted deletion rights or logic had to be added allowing them to stamp a field on the document that would remove it from the view; most notably, though, we now had to query a view just to determine summary information like total dollar amount, instead of restricting such calculations to the current document. We'd simply traded one set of maintenance concerns for another. So in many cases, the field grid pattern continued to be used despite another option having become available.

With a simple use of a Repeat, we can have the best of both worlds: the simplistic data structure of the field grid pattern with the limitlessness of the response doc / embedded view approach. The demo app shows this pattern in action, but during the webinar I felt I kind of rushed that portion of the demo in order to avoid eating into Q&A time. So I've promised Leedy I'll record a Notesin9 on this specific design pattern, which should allow a more thorough walkthrough of how the code works and the associated benefits. In the meantime, if you have any questions about this or the other patterns represented in the demo app, just let me know.

Comments

Gravatar Image1 - Thanks for the infinite form example. Hope to use it in an expense application that I have to build in XPages.

Dan

Gravatar Image2 - I've always felt that this was a major failing of the notes interface. In-view editing was another stab at resolving the issue, but that fell short of the mark as well.
This is one area where a look at how relational systems manage this could/would increase the usability of the notes client.

Gravatar Image3 - Ah... an instance of the venerable "Table Walker". How would you compare it to this:{ Link }

Emoticon stw

Gravatar Image4 - Great stuff, Tim. I'd especially be interested in the infinite form pattern. Could you put this on OpenNTF? Maybe as part of the next contest.

Gravatar Image5 - Great stuff indeed. The shortcomings of Notes Client in this respect are a reason why I incorporated XPiNC into a Notes Client app a while back. Performance of XPiNC wasn't great at the time, but flexibility offered huge benefits.

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)