Show TOC

Background documentationGeneric Events Locate this document in the navigation structure

 

The following lists the generic events that are triggered when the corresponding button is clicked in the generic toolbar at the top of the editor, and describes the default handling of the events:

  • Save: Executes the saveData() method on the editor's data handler. For more information on data handlers, see Step 3: Creating a Data Handler.

  • Close: Closes the editor.

    If object properties were changed (that is, the dirty state was set either by the property editor or manually by the editor), the editor framework first displays a dialog asking whether to save the changes. If the administrator clicks Yes, the saveData() method on the data handler for the editor is called.

  • Refresh: Calls loadData()on the data handler for the editor.

  • Edit Mode: Calls the loadData() on the data handler for the editor and tries to write-enable the editor.

    Edit Mode enables you to start editing an object that was opened in read-only mode. The editor may be in read-only mode because the object was locked when the editor was launched, or the administrator did not have permission to edit the object.

    Instead of having to close and reopen the editor, the administrator can click Edit Mode to check if the object is now unlocked or permissions were granted to edit the object.

  • Preview (no default implementation): Calls handlePreviewEvent() on the editor's event handler. The default event handler for an editor provides an empty implementation for the preview event handler.

Custom Generic Events Handler

You can override the default handling of the generic events by creating an event handler that either:

  • Extends GenericEventsHandler: You can extend the implementation of an event handler by overriding a handler method, providing your own implementation, and at the end of the method calling the same handler method in the super class.

  • Implements IGenericEventsHandler: You can replace the default implementation of the event handler for the Refresh, Edit Mode or Preview events.

To include a custom event handler, specify the event handler class in the com.sap.portal.admin.editorframework.eventsHandler property of the <component-config> element for the editor component in the portalapp.xml, as shown in the following example:

Syntax Syntax

  1. <property name="com.sap.portal.admin.editorframework.eventsHandler"
        value="myEventsHandler"/>
    
End of the code.