How to use Action events?

Who would give me an example of using events while saving a document?

I have added the following script to XWiki.JavaScriptExtension:

require(['jquery'], function init() {
//...
document.observe('xwiki:actions:beforeSave', function(event) {
  //document.fire('xwiki:inline:save', {originalEvent: event});
  alert('BeforeSave Trigger');
  }.bindAsEventListener(window));
  return XWiki;
}(XWiki || {}));
);

but when doc saved alert is not displayed.

Thanks.

See https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/JavaScriptAPI/#HBridgingcustomXWikieventsbetweenPrototypeandjQuery

It appears you’re mixing jQuery code with Prototype.js code which is not good.

Thanks for hint.

I have two save buttons on the form: one saves the values ​​of the selected checkboxes in the Livetable, the other (standard doc Save) - saves the whole document.
image

I find it so uncomfortable and superfluous and I am looking for a way to do one button :slight_smile: