วันศุกร์ที่ 27 พฤศจิกายน พ.ศ. 2552

Lotus notes : Modify a rich text field in the UI without having to save and re-open




One big issue with rich text fields is that "Modifications made to rich text items on the back-end document do not appear on the current document until it is closed and reopened." This means that any code you might have in the UI accessing a rich text field (create tables, append doc links, etc.) won't immediately show up without saving and re-opening.

Until now, either you saved and re-opened the back-end doc to reflect the changes to the rich text field (which meant that you also had to incorporate some sort of clean-up code if a user chose to cancel the save) or you don't reflect the changes in the UI, which can cause some user confusion ("yes, you did make the changes but you have to save and re-open the doc to see them").

With the following code, you can modify any rich text fields and reflect those changes in the UI without being forced to save the document. In this example, I am appending a document link but I have tested the code for creating a table as well. The user may notice a slight flicker as the document is closed and re-opened.

One other application for this code is Computed Subforms. In the Designer Help, it is stated that "Subform formulas cannot be refreshed while the document is open." This method of re-initializing the document in memory allows the Computed

ไม่มีความคิดเห็น:

แสดงความคิดเห็น