IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

A table on a table.We've been having a discussion internally about why it's not a good idea to put a rich text field in a table cell while designing a form, and the question was raised, do Domino developers know this?

So, just in case, here's the official line on putting a rich text field in a table cell: don't.

Tables generally are funny things; not everything can go into a cell. We've been gradually extending capabilities in this area -- for instance, you didn't used to be able to put a subform or (I think) a section in a cell, and now you can. But there are still some things that don't work in that context -- layout regions, for instance. If there's something you can't have inside a table cell, you can't have it inside a rich text field that's inside the cell, either.

So you would find that rich text content which is valid in other contexts can't be put into your field. You maybe can't inherit some rich text from another document that has its rich text field not in a table cell (or for that matter, inherit the whole document including the form, like the forward function in mail). There might also be some problems with margins (Can anyone with relevant experience elaborate?). Displaying the same rich text sometimes in a cell, and sometimes not in a cell, might not work totally as expected (e.g. if you have different Notes and web forms).

It also limits your ability to program tables in the rich text, because when you save a document that contains a table inside a rich text field that's inside a table, it gets treated as a nested table. The NotesRichText... classes don't deal with nested tables, so they can't even see this one. If the code that operates on the document is in a view agent or server agent, you wouldn't think that would matter, since these methods of accessing documents don't care about the form design. But it does matter in this case, because when you edit and save the document manually, the table is flagged as "nested" in the rich text data.

This particular limitation might not matter to you -- I have a feeling that applications that try to parse out data from user-entered tables are fairly rare -- but it's worth remembering.

Incidentally, no matter where your rich text field is situated, you can still get all the information from the document using DXL.

Andre Guirard | 1 May 2007 01:01:00 AM ET | | Comments (8)

Search this blog 

Disclaimer 

    About IBM Privacy Contact