Category Archives: event

Xpage Events doesn’t always work after partial refresh

>I had a strange error today, I had an Xpage that when you clicked in the navigation a partial refresh was done and a “document” was loaded into a panel with a title and some RichText displayed inside a computed text control it also had a Back button that executed some server side SSJS.

On some documents the back button didn’t work. I started to investigate.
I found that the javascript at the bottom of the returning partial refresh was never executed.
Something in the richtext HTML did this. But there was nothing wrong in the HTML.
I should also add that the problem only ocurred in IE 8 & 9 with compability mode.
No to the fun part how did I solve the problem.
I created a Div for holding the returning HTML
and below this in the Computed text control, I added a script tag that did a getElementById and assigned the Dokumenttext the tag using innerHTML but to assign the text I had to escape the HTML first in SSJS and then unescape it before I added in to the innerHTML