XPages Error Pages: Partial Refresh and JavaScript

Home » XPages Error Pages: Partial Refresh and JavaScript

Some weeks ago I was discussing an XPages query with a colleague from the community. I’d created a custom error page for my application and it worked well. But on some occasions, the buttons or links on my error page were not working. Eventually I tracked it down to confirm that the buttons or links worked if the page was triggered from a full refresh of the previous page (e.g. if the error occurred when the page was initially being rendered to the browser or following Server-Side JavaScript that performs a full refresh of the page). In these scenarios the browser’s URL was that of my error page, e.g. Error.xsp.

However, when the error page was triggered from a partial refresh, none of my links or buttons worked. In this scenario the URL also remained on the page that triggered the error. Similarly, when I looked at the HTML source, none of the partial refresh events were passed to the browser. After discussion, my understanding is that the XSP Command Manager doesn’t run the Java code for the error page, but merely writes out the text on the XPage. Event code is not passed.

The solution therefore was relatively simple, but effective: my error XPage now contains just basic HTML. If I want a link, I don’t use a Link control, I manually write an anchor tag. If I want a button, I write it in HTML. But how do you do this if you’re not au fait with web development? Simple again. Create your XPage using normal controls, view the HTML source, and then replace your XPage code with the HTML code.

2 thoughts on “XPages Error Pages: Partial Refresh and JavaScript”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top