XPages - My First Stumbling Block.

One thing I managed to do recently is get my hands on copies of Domino 8.5 -- designer and server. I'm now in the position to do what I've been meaning to for ages and delve in to XPages. I'd hate to get left behind and, having read nothing but gushing praise for them, I thought it about time I found out what all the fuss is about.

After all, I have a couple of clients who are moving (or have moved) to Domino 8.5, so I need to make sure I'm offering the best of everything I can.

The other day I fired it up and created an XPage called "test" inside a database called "test.nsf", as you do. Well, as I do. That's how I learn anyway -- just add loads of elements and mess with their properties and see what happens.

It wasn't long before I noticed something -- you can't add subforms. Or can you? A Google for "xpages subforms" hints at being able to, but for the life of me I can't work out how you embed one on to an XPage!

Assuming it is true that you can't, then this is a show-stopper for me. My whole approach to Domino design relies on the use of subforms and has done for eight years now. I understand that Custom Controls are like Subforms and could do away with them in XPages, but, unless you're creating a Domino website using nothing but XPages I can't see how that would work.

Every single page (mainly Forms) of every website I build with Domino uses a set of subforms called things like Header, Footer, Sidebar etc to contain the fixed HTML that makes up the design of the site. If XPages can't adopt this way of working then I can't see how I'd make them site inside my applications. And then there's the "Common Fields" subform that exists on all forms as well.

Can somebody put me out of my misery please? To save egg on my face I just spent another 10 minutes trying to work it out before pressing the publish button, but to no avail.


    • avatar
    • Jake Howlett
    • Mon 11 May 2009 04:00 AM

    Hi Jake. You here.

    I just read the wiki page you linked to in full and see its title is somewhat misleading as it's talking about using fields from subforms as data sources in XPages, so I guess you really can't use subforms.

    I can see why though, as XPages's underlying technology is different to what's gone before. Subforms probably don't fit in.

    Still, this is a massive issue for me.

  1. Custom Controls are the subforms "on steroids" for XPages.

    • avatar
    • Jake Howlett
    • Mon 11 May 2009 04:52 AM

    So I hear Steve. But. If I want to add an XPage in to my existing app (currently made of forms and views) and have it look like it fits right in to the design how do I add the HTML that makes up the structure of the site? I'm guessing I have to duplicate the HTML in a Custom Control somehow? If so then this goes against the whole idea of HTML stored in one re-usable subform in the first place.

    Of all the XPage demos I've seen so far I can't remember seeing one that show the central functionality of the XPage sitting *inside* a "normal" application that is made up of other non-X Domino elements. How would that work?

  2. Jake,

    XPages are a completely new way of developing web applications and as such do not sit inside your existing designs. You'll need to replace individual forms rather than just subforms.

    That being said you can make use of your existing form design to save having to re-write all of your computed fields etc. by using the "ComputeWithForm" property of your data binding in the XPages.

    As a getting started guide, I'd highly recommend Declan Lynch's series of articles: http://www.qtzar.com/blogs/qtzar.nsf/htdocs/LearningXPages.htm


    • avatar
    • Steve
    • Mon 11 May 2009 05:08 AM

    Unfortunately its a separate model - so whilst you can combine both in one nsf and one application/site - design wise there is no sharing of html structure (just css/resources obviously) or embedding one model into the other (so subforms into XPage design elements and vica versa).

    Of course there are always hacks to do stuff - like iframes linking to xpage components to embed that way in classic Domino design elements - but probably not worth the trouble.

    Theres a lot of how this fits that need writing up - and I keep trying to find the time to. If you get a spare couple of hours we can go through some of this if it helps - just call/email.

    • avatar
    • Jake Howlett
    • Mon 11 May 2009 05:15 AM


    "embedding one model into the other (so subforms into XPage design elements and vica versa)."

    I don't follow what you mean by "embedding one model in to the other"? Copying the HTML between them?

  3. Xpages demand a complete refactoring of almost any Domino app. Pretty much everything you've done before won't be usable in an Xpages context -- including pages containing Javascript, script libraries, forms & subforms, and most agents.

    Your forms and views still generally define your data storage structure. Though many Domino apps need to rethink even that. But all logic and presentation has to be rewritten given the Xpages approach. It's just too fundamentally different.

    It just happens to be WAY WAY better.

    • avatar
    • Jake Howlett
    • Mon 11 May 2009 07:10 AM

    Thanks Nathan. That's probably what I needed to hear. I'll look at XPages from that angle from now on.

  4. Jake,

    One encouraging sign is that it appears that XPages are going to work locally in the Notes client in an upcoming release.

    You would still need to change your development practices to the new XPages model, but at least you wouldn't need one model for the web and another for the standalone client.

  5. Jake,

    As Nathan mentioned a refactoring of your application in XPages is required. You'll also need to block out all the 'old ways' of designing a domino web app and just think of how it can be done in xpages.

    For the subforms that contain all your layout html etc, just create custom controls to duplicate and extend the functionality. if you look at the learning xpages series I wrote you'll see I made custom controls for each of the main sections on my webpage, inside each custom control i have more custom controls for content and I can dynamically decide if I want them to render to screen or not at runtime ( that's where things start getting very powerful )

    Your CGI subform is probably no longer needed, you can access all the cgi variables directly in server side javascript.

    The one thing I'll say about xpages is that there is a learning curve that you need to get over but once you do you'll never want to design the old way again.

    read the Learning xpages series and pull apart the xpage apps you find on openntf, the discussion db in 8.5 and TaskJam from Matt, they will all help.

  6. Jake,

    I wondered when you will get into the XPages game... welcome!

    You did superiour stuff with classic domino web development. But now, there is one single advice I can give you: forget all you know about classic domino web development.

    Forget the hacks. Forget the tricks. Do not think about that anymore.

    After you forgot all that, close your eyes and clear your mind.

    Then work through Dec's XPages tutorial. Finish it until you do stuff of your own.

    Then take an example usecase and build it with XPages.

    Then buy a book about Dojo and read it from page to page (my suggestion is the Dojo book from O'Reilly).

    After that you are finally good to go for customer projects :-)

    It's some work, but it's fun and worth it.

    And on your journey you might find one or the other usefull trick in our Wiki at http://www.youatnotes.de/web/youatnotes/wiki-xpages.nsf .

    • avatar
    • Darin
    • Mon 11 May 2009 08:08 AM

    Glad to see you looking at xPages. I have found your site to be a great resource in the past. When I started working on xPages, there were very few resources and it took a few days, to just get everything in perspective. I have now built a full functional xpages commercial site in xPages for a client. I could have done it the old way and somethings I would have finished faster, however the over all project would have taken me longer with traditional hacks. I now have a site that has very fresh UI that makes use of ajax and dojo features.

    I found resources at:





  7. Jake,

    I found digging through the free TaskJam sample xPage database very useful (www.elguji.com). It follows a logical and easy to maintain structure similar to how you advocate for traditional domino web design. It uses a few custom controls to provide headers, footers, sidebars, common fields and functions as you have done with subforms in the past.

    Good Luck.

  8. My biggest gripe with XPages is all the resources that are loaded automatically.

    It's ok if you're building a web -application-, but I can't bring myselft to build webpages that loads 30+ JS files and 10+ CSS-files.

    I hope IBM implements something like YUI's Combo Handler CDN service.


    With proper server-side caching, gzipping and minifying, I'd think this could improve the load-time/performance (if lazy loading is involved) of pages by quite a bit. Especially for high latency clients.

  9. @Declan Lynch "Your CGI subform is probably no longer needed, you can access all the cgi variables directly in server side javascript."

    I think I'm in love.

  10. Now well into xpages after a week or two of horrors.

    The way I did it was rewriting my main data app in xpages.

    The subform thing doesn't bother me, custom controls are fantastic.

    Got to say I now want to redo everything in this new way.

    However the lack of a WQS is a real pain. There is a cludge where you can get a handle on a saved document, but what if you don't want to save the document?

    90% of the time I just want to grab entered values from the context then chuck the document away.

    Suppose could run a delete junk docs agent every night.

  11. Forgot to say of course you can use server side javascript to do a lot of wqs type stuff, but what if, as in my case, my wqs's are almost entirely Java, calling JFreeChart and iText and other such Java libraries...Any suggestions?

    • avatar
    • Felix
    • Tue 12 May 2009 12:51 AM

    I read a lot of positive thing about XPages. Currently we develop a lot with JQuery. Should we move to DoJo, or doesn't it really matter which library you use?

    • avatar
    • Felix
    • Tue 12 May 2009 12:52 AM

    Especially considering this chart:


    that shows jquery seems to gain much more momentum than dojo.

    n.b.:Jake, thank you for your perfect site.

  12. @Felix: The Dojo/Dijit libraries are loaded automatically by the server. The most efficient way of working would be to learn/use Dojo.

    Dijit has some nice widgets:


    There are Dojo extensions (DojoX) that lets you do charting as well.

  13. Jake,

    I admire the way you've been able to keep apart from the XPages stuff till now, in spite of all the buzz and noise at the community.

    I'm sure we'll be able to find good XPages articles here in the next weeks.

  14. I believe Custom Controls are your solution for the X-Pages. But yes it is focused on the web version of the application. I believe that in upcoming releases, the Notes client will support X-Pages.

  15. dojo & ie8? - Oh dear.


    Where are we at the mo with dojo and Domino Is it 1.1.1?

  16. Hi Jake,

    I share your pain on this one. I too am a "subform user" in all my web applications, and I was hoping that you'd have the solution to this little thorn in the side.

    Like you, most of my apps have common html that's used on (nearly) every form, and therefore, shoving all this into subforms saves lots of time. For example, one of my subforms contains the beginning of a html tag set, and another closes said tag set. Placing these two subforms into a form creates a "container-like" html element. I like that design method, so naturally, I *expected* XPages to accommodate. And so, noting that custom controls are supposed to be "subforms on steriods", I added some custom html to a custom control and hit 'save' ... only to find little red X's in my designer sidebar because my html elements are unclosed (WTF?! ... ugly).

    And so, as I hear that the new XPages method means throwing out all aspects of traditional Domino Dev, I wonder how we're supposed to store partial html blocks without those ugly errors. Further, I note to myself that our method of subform development is a very, very good way to design new applications, and now I'm stuck. The only other solution that I see is to retype this common html e v e r y time a new XPage is created... which is not ideal. In my opinion, this is a major drawback to XPages development. (Not to mention what happens if the user turns off JavaScript)

    I liked subforms just fine before they went on the juice.

  17. Hi Jake,

    I'd leave Xpages well alone if I were you. I've been using them for some time, and to sum up, they are horrible and temeramental for developing all but the simplest tasks. In theory, they are a great idea, but in practice, fall woefully short. For example, just having an icon appear in a viewpanel column if field x="1", and another if field x="2", is massively over-complicated and time consuming, it's ridiculous. The whole point of XPages is that it is supossed to be Rapid Application Development technology for the web - something that is long overdue, but this is not the case in XPages development.

Your Comments


About This Page

Written by Jake Howlett on Mon 11 May 2009

Share This Page

# ( ) '


The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social

About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content