Change comment:
Caveat: event.memo.continue is invalid syntax
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. VincentMassol1 +XWiki.Sergiu - Content
-
... ... @@ -47,10 +47,10 @@ 47 47 * **##xwiki:actions:preview##** 48 48 This event is sent after ther use clicks the "Preview" button of an editor (Wiki, WYSIWYG, object, rights, etc.), but before actually leaving the edit mode. 49 49 * **##xwiki:actions:save##** 50 -This event is sent after the user clicks the "Save" or "Save & Continue" button of an editor (Wiki, WYSIWYG, object, rights, etc.), but before actually submitting the form. A memo is available if you need to know if the intend is to continue after the save, in ##event.memo .continue##. You can use it as follows:(((50 +This event is sent after the user clicks the "Save" or "Save & Continue" button of an editor (Wiki, WYSIWYG, object, rights, etc.), but before actually submitting the form. A memo is available if you need to know if the intend is to continue after the save, in ##event.memo['continue']##. You can use it as follows:((( 51 51 {{code language="javascript"}} 52 -document.observe("xwiki: dom:loaded", function(event){53 - var doContinue = event.memo .continue;52 +document.observe("xwiki:actions:save", function(event){ 53 + var doContinue = event.memo['continue']; 54 54 if (doContinue) { 55 55 // do something specific 56 56 } ... ... @@ -57,6 +57,8 @@ 57 57 }); 58 58 {{/code}}))) 59 59 60 +{{warning}}Caveat: While most properties can be accessed as ##event.memo.property##, this doesn't work with ##event.memo.continue## since ##continue## is a reserved keyword.{{/warning}} 61 + 60 60 All these events contain as extra information, in the second parameter sent to event listeners (the memo), the original click event (if any, and which can be stopped to prevent the action from completing), and the form being submitted, as ##event.memo.originalEvent##, and ##event.memo.form## respectively. 61 61 62 62 === Document extra events (xwiki.js) === ... ... @@ -78,7 +78,7 @@ 78 78 79 79 === WYSIWYG events (XWikiWysiwyg.js) === 80 80 81 -WYSIWYG has it's own custom [[events list>>extensions:Extension.W ysiwygEditor Module#HCustomevents]].83 +WYSIWYG has it's own custom [[events list>>extensions:Extension.WYSIWYG Editor Module#HCustomevents]]. 82 82 83 83 === Suggest events (ajaxSuggest.js) === 84 84