Client Side Events for Input Forms

New Input Form Methodology 

As of December 2010, the revised Content and Module Definitions have a much richer API to work with for creating and customizing content and module structures.

Custom input forms no longer use server-side markup.  All of the UI is generated using client side elements and jQuery plugins.  Older input forms that were customized using server-side code will still execute and can be edited, but any newly customized input forms must use the new client-side methodology. 

Client Side Events

The following events are available for customized input forms:

Event Name
Description
onLoad
  • Called just before a content item is initially loaded into the UI.  This event is NOT called after the content item is saved.
onContentItemLoaded(ContentItem,
      ContentView, ContentDefinition)
  •  Called when the current Content Item, Content View and Content Definition are fully loaded
  • This action occurs before the input form is fully rendered and the content Item values have not been set on the input form HTML Controls
  • See onLoadComplete for fully loaded content item input form
onLoadComplete(contentItem)
  • Called immediately after the content item has been loaded.
  • An instance of the current content item object is passed to this event as a parameter.
  • Any UI controls that load asynchronously may not have been fully initialized when this method is called.
onBeforeSave(contentItem)
  • Called immediately before any save operation on the content item.
  • An instance of the current content item object is passed to this event as a parameter.
  • Return false from this event to cancel the save operation.
onAfterSave(contentItem)
  • Called immediately after any save operation on the content item.
  • An instance of the current content item object is passed to this event as a parameter.
onBeforePublish
  • Called immediately before any publish operation on the content item.
  • Return false from this event to cancel the publish.
onAfterPublish
  • Called immediately after any publish operation on the content item.
onBeforeApprove
  • Called immediately before any approve operation on the content item.
  • Return false from this event to cancel the approve action.
onAfterApprove
  • Called immediately after any approve operation on the content item.
onBeforeDecline
  • Called immediately before any decline operation on the content item.
  • Return false from this event to cancel the decline action.
onAfterDecline
  • Called immediately after any decline operation on the content item.
onNew
  • Called immediately before a new content item is about to be initialized in the input form
onBeforeDelete
  • Called immediately before any delete operation on the content item.
  • Return false from this event to cancel the delete action.
onAfterDelete
  • Called immediately after any delete operation on the content item.
 

In order to implement one of these events, simply add JavaScript code to the Custom Scripts tab on the Content or Module Definition.   

onLoadComplete = function(contentItem) {
//perform any load actions
};

onBeforeSave = function(contentItem) {
//perform any after save actions
};

onAfterSave = function(contentItem) {
//perform any after save actions
};

LOGIN

Log in with your Agility username and password or
register for the site




Log In

REGISTER












Register

FORGOT PASSWORD