Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-13028

It's hard to catch the 'xwiki:actions:save' event before the save request is sent

    Details

    • Development Priority:
      High
    • Difficulty:
      Easy
    • Similar issues:

      Description

      When you click on the Save & Continue button from any edit mode, the xwiki:actions:save event is fired by actionButtons.js. The problem is that actionButtons.js is adding a listener to this event on xwiki:dom:loaded (which is very early) in order to perform the AJAX save & continue. So by the time you add your own listener from a script that was loaded later (e.g. with Require.js) the actionButtons.js listener was already added so you will be catching xwiki:actions:save after the save request has been sent. This prevents you from updating the content (e.g. serialize some data from a JavaScript widget that you are using).

      The current workaround is to attempt to add your listener before xwiki:dom:loaded is fired, but this can be difficult or even impossible. We should modify actionButtons.js to fire a xwiki:actions:beforeSave instead.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mflorea Marius Dumitru Florea
                Reporter:
                mflorea Marius Dumitru Florea
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: