12/21/2009
Handling Agility Save Events in Client Mode
Posted by
Joel Varty
One of the features we added this year was the ability to write Input Forms for Content Definitions and Module Definitions that are for "client side save", which means that the values of the content item are saved using Javascript instead of a postback.
In order to handle before and after save events for these, you need to do the following:
ContentItem_BeforeClientSave = function () {
alert("before save!");
return true;
}
ContentItem_AfterClientSave = function (contentItemID) {
alert("after save - " + contentItemID);
}
The "before save" is a cancel-able event - meaning you can return false to stop the save from happening. This is great if you need to do some extra validation. The regular field validation will run after this.
The "after save" is a chance for you to run a script after the save has successfully completed and all of the attachments and linked content areas have been updated. This event will run even on a save-and-close - so you should test it in all the save situations (save, save and close, save and preview).
These events are especially useful if you have linked content on the item that you want to show only after the item has been saved for the first time.
more later - joel.
« Back to Blog
Main Page |