Client-side error handling
Disabling the standard error dialog
By default, when an Ajax error happens, Orbeon Forms shows users an error dialog.

You can disable this behavior by adding this property to your properties-local.xml:
JavaScript event handler
Orbeon Forms exposes a custom JavaScript event: ORBEON.xforms.Events.errorEvent.
By default a dialog is shown to the user when an error is intercepted. If you prefer to show your own dialog or to implement some other behavior in case of error, most likely you will want to:
Disable the default error dialog by setting the
oxf.xforms.show-error-dialogproperty tofalse.Register your own listener on
ORBEON.xforms.Events.errorEvent.
You can register your own listener on that event, and when fired, send users to a page you choose, as done in the following snippet, which sends users to the Orbeon home page:
Example
In case the user session expires, or some other error happens, you would like to redirect them a page you created that will, for instance, tell users to log in and try again, and if the problem persists to contact customer support.
Providing your own dialog
By default, the source markup for this dialog is available under:
This file is located inside the following jar file:
[SINCE Orbeon Forms 2016.3]
WEB-INF/lib/orbeon-core.jar[UP TO Orbeon Forms 2016.2]
WEB-INF/lib/orbeon-resources-private.jar
You can override it in two ways:
Globally, by placing your own
error-dialog.xmlfile underWEB-INF/resources/config.Per application, by placing your own
error-dialog.xmlfile underWEB-INF/resources/apps/$app, where$appstands for the name of your application.
Example: default dialog
The default dialog provides classes allowing for opening/closing a details section:
Example: minimal dialog
At a minimum, the file should contain the following structure:
CSS configuration
Advanced developers can configure the appearance of the error dialog. In most cases overriding CSS definitions should be enough.
Last updated