Sharing Design Elements

The more I use Domino 6, the more I grow to like the new features. Some of them really makes improvements to the way we can make websites stick together.

One of these features is the ability to include design elements on our forms from other databases. For example, you can include views and subforms.

Not all that glitter is gold though. At first I thought that embedding subforms from other databases would be a great way of creating modular designs, where the same layout was applied to several databases. That was until I found that you can't embed a subform from another database when that subform has other subforms nested within it! Even if the nested subforms are in the same database as the subform you want to include!!

Something else I don't understand is embedding views from other databases. It's a great idea but I don't really understand how it works, and I don't trust things I don't understand. Here the view embedding dialog:

Insert View Dialog

Notice we can choose another database whose views we can select. The first thing I don't get is where this list of database is derived from. Anybody know? They aren't in my bookmarks. They are on the Workspace, but in no particular order and there are some in there that I'd forgotten existed.

The other thing I don't understand/trust is how the link to this embedded view is maintained.

Note: This is really me being lazy. If one of you can help out, that's great. If not, I will endeavour to find the answer and let you all know.

Ok, so you've embedded the view from Database A in to Database B. Here, I assume, Database B remembers the location of the view using something like the Replica ID of Database A. If you then create a new copy of Database A it will still find the view. What happens though if you create a new copy of both databases A & B? Do you have to update the design of Database B to point to the new Database A?


    • avatar
    • Esther
    • Mon 26 Jul 2004 08:40

    Jake, I don't know how the link is maintained, but I think the list is generated the same way as the list you get if you create a listbox/dialog list/etc. field and choose Use View Dialog for choices. As far as I can tell, the list is generated from your local desktop.ndk db.

  1. The embedded view list seems to come from the "Recent databases" bookmarked in designer. What continues to REALLY sucks about ND6 embedded views is that you can only embed one as HTML. All others need to be rendered in the crummy java view applet or else everything blows up. We've worekd around some of this with computed value fields doing lookups, but that's clunky at best.

    • avatar
    • Jake
    • Mon 26 Jul 2004 08:55

    Recent databases? I've not looked at some of them for over a year ;-)

    • avatar
    • Michael
    • Mon 26 Jul 2004 09:01

    I'm not a fan of the embedded views from other databases as the embed dialog does not include the path. I'm guilty of not changing the db title when testing out changes. I'm not sure how this feature is compatible with using ntf templates when deploying multi-database applications.

    The property window for the embedded view does not offer any insight regarding the source of the view. I'll try using NotesPeek later to see if that offers any clues.

    My hunch other database list that appears in the embed dialog is the (All Bookmarks) view from the bookmarks.nsf.

  2. Kelvin, create a JavaScript wrapper for your "extra" views and import them onto the document as files that write the HTML. Works great, as does scraping the HTML from a zero-size <iframe>'s content:

    document.getElementById('targetTable').innerHTML = document.frames['iframename'].document.tables[0].innerHTML;

    • avatar
    • Khalen
    • Mon 26 Jul 2004 10:01

    A form exported to DXL will show that an embedded view is linked to via a ReplicaID and a view name.

    Unfortunately, specifying this ReplicaID at design time is denied. For whatever unholy reason; I do not know.

    Currently I'm having problems with an embedded view accessing the development server in a production deployment.

    Needless to say this has caused quite a few hours of frustration and a maltreated mouse and keyboard.

    Buyer beware!

    • avatar
    • Cesar
    • Mon 26 Jul 2004 11:33

    I hate not being sure about how this link is established. "Strange" things happen when you don't know the details: once I was sure I had correctly embedded a view and whenever I opened a document I saw a gray rectangle (it didn't find the embedded view).

    After some minutes of frustration, I discovered that somehow it uses the selected server for the replica that you have selected on your workspace! I was working in Server "B" in the Bahamas, but had a replica of that db in the USA (another server). I then added the view and embedded it in Server "B". But then in my workspace I selected the replica in USA. And it was trying to open the embedded view from the Server in the USA even when I was working with documents in Server "B". It didn't exist there since I hadn't replicated. As soon as I selected (just selected, not open) the replica in Server B, the embedded view appeared.

    Anyway, a case that it's difficult to explain. Embedded views are great, but I feel nervous selecting from that list.

  3. If you use templates to deploy your apps all of this embedding design elements from other databases is useless, as I think the link is maintained using replica id. So when you go onsite and create new databases from your templates nothing works!

    This could be worked around, but if you want seperate live and test environments you're screwed again!

  4. Guys,

    when you specify a replica id on its own, Notes normally looks at the last (topmost when stacked) replica (server). Sounds like its working as disigned ...

    Stan, I may be alone here, but I'm not sure what your code does ...


    • avatar
    • Andrew Tetlaw
    • Mon 26 Jul 2004 20:07

    This 'view from other database' thing is yet another half-arsed Notes feature; it's a neat idea with a sucky implementation.

    Basically in any properly managed infrastructure it's completely unusable for all of the reasons already mentioned.

    If you think about it it's really designed from a content creators point of view , not a developers POV.

  5. A couple of things overlooked: Computed subforms and embedded views designated by formulas.

    I think the GUI ability to embed a designated element is there because the ability to include them on a computed basis is there. IBM (or whomever is responsible for development these days) simply put a set of controls on top of the same mechanism for completenes sake.

    It's cool that you can use computed values for subforms because I'm pretty sure you can specify the repID of the source DB and the subform name. Not sure on the context yet, but it seems pretty intuitive.

    I can confirm the links are maintained via replica ID in a reserve field on your form. I wrote about it here...


    (see the fourth paragraph)

    ... a while back. ;-)

    • avatar
    • laurens
    • Mon 13 Sep 2004 09:01


    In a database A in Designer I wanted to add an embedded view of database B. I opened database B also in Designer, so I could select database B from the "Insert Embedded View" dialog. Database B was there all right, but there were no views I could select from. The view selection area was blank. Although I was designing on Server 1 and both database A and database B were on Server 1, I had to open database B on Server 2 as well in the designer, to make the viewlist visible in the Insert Embedded View dialog.

    Only cost me three hours to find out.

Your Comments


About This Page

Written by Jake Howlett on Mon 26 Jul 2004

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