Showing posts with label Rich Text. Show all posts
Showing posts with label Rich Text. Show all posts

March 24, 2011

Error: Saving this document will change its format

I have an XPage that is used for editing news. Those news may be created from the Notes client and contain some Rich Text fields.

When editing the news I get an error like this:


Saying: Saving this document will change its format from native Notes rich text to HTML. This may cause a change or loss of formatting if opened again in the regular Notes client.

What "damage" might this inflict? And are there any way to avoid this smoothly?

March 10, 2011

Debugging tip: insertNotesClientLinks852

Today I got this fairly unknown error when trying to access a document with a XPage.

The runtime has encountered an unexpected error.

Error source
Page Name:/myXpage.xsp


Exception

java.lang.StringIndexOutOfBoundsException
java.lang.String.substring(String.java:1092)
com.ibm.xsp.model.domino.wrapped.DominoRichTextItem.insertNotesClientLinks852(DominoRichTextItem.java:387)


After doing a quick search on google I found a post on the IBM forums claiming this had to do with bad HTML markup within a Rich Text field.

Unfortunately this particular Document had tons of HTML, so it took some time narrowing it down. After some 30 mins I discovered the error was caused by a anchor tag where the href attribute was missing a " at the start...

Anyways.. problem solved!

March 1, 2011

Solved:Display picture from Rich Text Field with XPages


Im having a Form where I have a Rich Text Field(lets call it imageField) added there to hold an image. The user of the Form will directly copy an image into the imageField , not the location of the image, THE image will be copied into the field.

When I then later try to display this image on a Xpage nothing comes up..

Google wont help me with this particular problem either. Anyone out there know how to do this?

SOLVED:
As Ben over at My Comfy Chair pointed out this is in fact quite easy to solve.

Start by making the Rich Text Field save as HTML and MIME. After that you simply refer to the field in the src part of the img tag:
src=\"myView/"+itemInView.getDocument()+"/FieldName/M2?OpenElement"

Worked like a charm for me! Thanks alot Ben!

October 28, 2010

[XPages] Tip When Using CKEditor On Site Behind IIS

A quick tip if you are building an XPages site that is placed behind IIS.
When you are using the CKEditor (default RichText editor in 8.5.2), remember to edit your plugin-cfg.xml to direct requests to  "/ckeditor/*" to the Domino server.

This is achieved by adding a line to plugin-cfg-xml looking like this:
<Uri Name="/ckeditor/*" />

Hints that this is required include the faact that the rich text editor is not displayed and that your browser displays error messages like this:



For more info on the plugin-cfg.xml file and XPages, have a look here and here.