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.
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. 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.
locating XPage components with XspQuery
Sun, Apr 14th 2013 12:00a Tim Tripcony Several years ago, I wrote a utility Java class designed to make it easy to search for components within the current XPage instance based on various criteria. I've found it enormously useful, and, apparently, so has Keith Strickland, because he added it to org.openntf.xsp.extlib, complete with a few refinements. As an example of how you might use this, examine the following line of code:
List requiredFields = new XspQuery()
.loc [read] Keywords: ldd
your how is not your what
Wed, Apr 3rd 2013 11:36a Tim Tripcony I've noticed a pattern emerging when I'm asked for help with XPages. Here's a representative conversation:
"I'm trying to do [X] and it's not working. How can I do that?"
"What are you trying to accomplish?"
"I already told you. I'm trying to do [X]."
"No, that's how you're trying to do it. What are you trying to do?"
For example, replace "[X]" with "reach into a repeat control from outside it" (since this has become the most frequent topic I'm asked about [read] Keywords: xpages application
my new favorite quote
Sat, Mar 23rd 2013 5:20p Tim Tripcony "We go about our daily lives understanding almost nothing of the world. We give little thought to the machinery that generates the sunlight that makes life possible, to the gravity that glues us to an earth that would otherwise send us spinning off into space, or the atoms of which we are made and on whose stability we fundamentally depend. Except for children (who don’t know enough not to ask the important questions), few of us spend much time wondering why nature is the way it is; where the [read] Keywords: wiki
Taking the scary out of Java in XPages: Prologue
Tue, Feb 26th 2013 9:50p Tim Tripcony The discussion following my last post made stark the need for greater availability of information that makes the nature of Java more accessible to Domino developers. Credit for the title of this post goes to Declan, who is considering writing a series of blog posts on this topic. I will be doing the same; hopefully there will be a fair amount of duplication. As David Leedy is fond of stating, it's a good thing when several people share the same information, because that makes it easier for the [read] Keywords: domino
Passthru vs. component - my perspective
Sat, Feb 16th 2013 9:40p Tim Tripcony Paul Withers posted a thorough article explaining the differences between namespaced XPage components (e.g. ) and their corresponding passthru elements (e.g. ), providing numerous examples of what actually happens when these objects are constructed. I've always heard (and often repeated) that passthru elements are more efficiently processed than their namespaced equivalents, so Paul's post inspired me to offer my own perspective.
Simply put, there's practically no difference... but there a [read] Keywords: acl