I am working on OJS plugin and would like to update the DOM when my settings form has been saved successfully. I am using the following code in my form class
public function execute() {
$contextId = Application::get()->getRequest()->getContext()->getId();
$this->plugin->updateSetting($contextId, 'secretKey', $this->getData('secretKey'));
// Tell the user that the save was successful.
import('classes.notification.NotificationManager');
$notificationMgr = new NotificationManager();
$notificationMgr->createTrivialNotification(
Application::get()->getRequest()->getUser()->getId(), NOTIFICATION_TYPE_SUCCESS, ['contents' => __('common.changesSaved')] );
return parent::execute();
}
How can I call a JavaScript function when the form has been saved and the notification has been shown on the page. I can see events: null
in the response but do not know how to hook into it and call a JavaScript function. Is this possible?