Allow reporting a message on action failure (for ajax actions)
When an ajax action (using
[ajax]attribute or when already in ajax context) fails due to a server error (such as “could not dispatch to a proper action”, because the action is no longer available), display an error to the user.
An update to
common_.csswill place the error message in a full-width bar at the bottom of the page (dismissible). The default message will be:
Error while handling this action, the server returned status 503/404/…. The action may no longer be available. Copy your unsaved changes before leaving/refreshing this page.
This failure message can be customized by:
Submitted by Elmer van Chastelet on 15 March 2019 at 10:50
- setting a page-specific action failure message
- by using
actionFailureMessage( "Error while processing this action, ..." )(builtin.app)
- by setting js var
- setting an action-element (button, submitlink) specific message using attribute
submitlink save()[data-action-failed="Could not save your answer. Copy your unsaved changes before refreshing/leaving this page."]