A topic in the wish list of a Notes developer made me think: Is it possible
to have some kind of dynamic HTML, like a table, in a Notes form, which
can be refreshed, while the document remains open?
Actually, without the last part, it's
quite easy:
- Create a form with "Render pass through HTML in Notes" set
- Create a computed text to calculate the HTML and mark the paragraph containing it as "Pass-Thru HTML" in the Text menu.
That's it.
When you create a document in this form,
the HTML is calculated and rendered. When you open an existing document,
you can even use this document's items in the formula of the computed text.
But (and this is a big BUT):
The HTML is only calculated, when you open the form; it doesn't get refreshed,
when you change the document's fields.
And there is a solution for this problem:
Just some more steps to do:
- Create a form with "Render pass through HTML in Notes" set
- Create a "Computed for display" text field named "SaveOptions" with "0" as constant value:
- Create a "Computed when composed" text field named "Form" with the form's name (or its alias) as constant value:
- Place some more fields on the form to later use their values. Then add a "Computed Text" and mark it as "Pass-Thru HTML" (in the Text menu):
- In its formula calculate some HTML, like this HTML table:
- And now for the magic: Add a button, an action, or a sub with the LotusScript code like this:
A reference to the current back-end
document (NotesDocument) is saved in the doc variable (but not on disk!),
then the current front-end document (NotesUIDocument) is closed and the
back-end document doc is opened again.
The Form field is important thus the
Notes client knows, which form to use, when the document is re-opened.
This item is created automatically, when a document is saved, but we don't
save it for now, thus we have to create it manually.
The SaveOptions field is important,
because without it, the user would be asked, if he wants to save the document,
when it get closed.
- To save a document in this form, you have to remove the SaveOptions item:
You can download a very small sample
database with the HTML form I created here: DynamicHTMLInNotes.zip.