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.
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
Dan
Posted by Dan Soares At 04:42:09 PM On 07/31/2012 | - Website - |
This is one area where a look at how relational systems manage this could/would increase the usability of the notes client.
Posted by Wayne At 08:20:38 AM On 07/31/2012 | - Website - |
Posted by Stephan H. Wissel At 05:08:04 AM On 07/31/2012 | - Website - |
Posted by Niklas Heidloff At 03:54:15 AM On 07/31/2012 | - Website - |
Posted by Paul Withers At 07:57:42 AM On 02/26/2013 | - Website - |