This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 29, 2011, 10:00 PM
10 Posts
topic has been resolvedResolved

How To Copy a Rich Text Field on the Notes Client

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags: rich text,client,copy
  • Replies: 3
I have an xPages application on the Notes client, and am using a lookup to a view to produce different help documents for each area of the application.  These help documents can contain screen shots, links, and text.
 
I use a dijit.Dialog to display another xPage which just contains a rich text field and a close button.  Into this rich text field, I want to dump the value of the rich text field from the looked up help document, but I can't seem to get this to happen.  Here is what I have in the data area of the blank rich text field
 
var helpDocUNID = @DbLookup(@DbName(), "AdminHelpMaint", "Employer Profile", 2);
var doc = database.getDocumentByUNID(helpDocUNID);

 
This gets me the correct document.  However, return doc.getValue("Help_Instructions");  just gives me a blank xPage.
 
If I use:
var stream = session.createStream();
var entity = doc.getMIMEEntity("Help_Instructions");
stream.close();
 I also get a blank xPage.
 
If I add:
entity.setContentFromText(stream, "text/html;charset=UTF-8", 1725);
before the stream.close() I still receive a blank xPage.
 
If I just use the doc.getMIMEEntity.... and return entity without using the stream stuff I get "lotus.domino.local.MIMEEntity@42d142d1"
 
If I just have text in the help document, I can see it no problem, it's just once I start putting rich text items into it, that I can't retrieve the field data.

How can I copy all the data over from the Help rich text field and display it, in it's entirety, in the display xPage?  This should be so simple, so maybe I'm just doing something incorrect.
May 1, 2011, 11:47 AM
261 Posts
Re: How To Copy a Rich Text Field on the Notes Client
I'd try a different approach: in the dijit.dialog you could add a panel control and set the target document as the data source for the panel. Add a rich text control to the panel, bind it to the correct rich text field and set it to be read only.
May 2, 2011, 8:44 PM
10 Posts
Re: How To Copy a Rich Text Field on the Notes Client
Thanks Mark!  A much more elegant way than what I was doing.  I'm trying to get it working but I think my problem now is that I'm using an iframe in the Notes client in which to display my xPage, so I believe it's the authentication problem I need to get past.  The reason I think this is, while I could produce the xPage with straight text on it before, now I'm getting an Error 401.  And I've come across this article -> http://lotusnotus.com/lotusnotus_en.nsf/dx/http-authentication-from-xpinc-got-help-found-bug-worked-around.htm.  So as soon as I get that going, I think your solution is the best.
May 6, 2011, 5:48 PM
10 Posts
Re: How To Copy a Rich Text Field on the Notes Client
It works!  Thanks Mark!

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal