Add content to inputRichText control (CKEditor)

importPackage(com.ibm.xsp.http);
document1.setValue(bodyFieldName, com.ibm.xsp.http.MimeMultipart.fromHTML("<p>HTML example</p>));





This small snippet of code add rich text content to an inputRichText control. The trick is to use the com.ibm.xsp.http.MimeMultipart.fromHTML() method to convert HTML to MIME, as the inputRichText control expects MIME for its setValue() method.

I have blogged in more detail about this at http://per.lausten.dk/blog/2012/12/xpages-dynamically-updating-rich-text-content-in-a-ckeditor.html

JavaScript (Server)
Per Henrik Lausten
December 5, 2012 5:11 AM
Rating
117

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.



No comments yetLogin first to comment...