xPages-Pulling RichText from existing Notes docs

I have existing content in RichText fields which I want to pull into an xPage. I’m currently using getItemValueString which, of course, strips all the formatting and also clips the text. Any way to keep the content in the RT fields intact?

thanks

clem

Subject: *Can you use the rich text control?

Subject: Tried that…

I put a richtext control and tried:

return doc.getFirstItem(“WebPageContent”);

But nothing showed up, just the field name.

clem

Subject: Do you have a document data source on the page

Just select the name of the rich text field on the Notes document in the Data tab of the rich text control.

Howard

Subject: Nearly there…

I created a test xPage and did as you suggested and Bam! – the RT content shows up nicely! Thanks.

Here’s the rub, tho. I’m passing a sessionScope variable as an index to identify which Notes document to use as the content source. So I can’t do the binding in the same way as in the test page I set up.

Subject: Doesn’t your session scope var contain the doc unid?

I assume you are identifying the form in the data source and computing the doc unid to display? If not, you should be…

Howard

Subject: Thanks!

Hey Howard

thanks for the leading questions. :wink: I was working on a response to your post and in that process of trying to explain myself, I figured it out.

The solution was in the ‘document id’ in the data source of the xPage. That was not defined. After adding some javascript to pull in the unid of the back end document into that field, the rest just worked! Many thanks!!

clem

Subject: You are welcome and for more XPages training check out our line of XPage courses

http://www.learnxpages.com

Howard