PreviousNext…

Quick XPage and rich text editor gotcha

A wee gotcha I encountered this week. Anyone who’s done Domino development is familiar with URLs that look like this:

/0/83175A727DC5124200257A9A0025A7EE?EditDocument

of course, these have changed somewhat in vanilla XPages apps, and look something like this:

/page.xsp?action=openDocument&documentId=83175A727DC5124200257A9A0025A7EE

As you are no doubt aware, you can still the use the “original” URL style if you’re XPageifying (technical term) an existing app. For example, my app contains views which generate the old-style URLs, yet its documents now open in spiffy new XPages rather than using their old web forms. This is achieved by making use of a form property which has documents using the relevant form open in a specified Xpage instead.

This is all well and good until it comes to using the in-built CKEditor to render rich text fields—specifically when dealing with image uploads (possibly files too, haven’t tried them). To reproduce the bug, open a document within an XPage with the CKEditor using the old Domino URL format. Then insert an image and save. This will work just fine when creating documents for the first time, but try editing said documents (again, via the old URL format—that’s important!) and inserting more images. The CKEditor image upload controls throw a hissy fit, resulting in server errors similar to this:

HTTP Web Server: Unknown Command Exception
[/SomeNSF.nsf/0/SomeUNID?$$axtarget=view:_id1:inputRichText1&$$viewid=
!dap2navke5!&command=QuickUpload&type=Images&CKEditor=
view%3A_id1%3AinputRichText1&CKEditorFuncNum=0]

Ugly innit? The tell-tale sign here is the lack of querystring in the generated URL, hence the error. If you edit the same document via the xsp URL route, no problems at all.

I would contend that this is a bug given that Domino URLs are a supported feature of the server, but have no idea where it sits in terms of priority—or indeed whether IBM know about it at all, so be warned!

(My thanks to Matt for his invaluable assistance earlier today).

Comments on this post are now closed.

About

I’m a software architect / developer / general IT wrangler specialising in web, mobile web and middleware using things like node.js, Java, C#, PHP, HTML5 and more.

Best described as a simpleton, but kindly. You can read more here.

";