OJS3 : Update page HTML upon receipt of notification

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?

Hi @otuomasp,

Can you elaborate what plugin you’re working on (and what version of the plugin - include the github repository if possible)? Or are you creating a separate plugin that does not work yet? ,

-Roger
PKP Team

It is an importexport plugin I am developing to export submissions via SFTP. So far it is working well but I need to improve just a little further.

See the settings form below. It is submitted via ajax and a notification shown when it is saved successfully. The settings tab works exactly the same way CrossRef XML Export Plugin works. But in my case, when the form is saved successfully, I want to remove the text in red above the form.

image

Thank you @rcgillis for looking into this. OJS version is 3.1.2.3. I have not pushed the code to a public repository yet.