The notification system
While single module/action requests commonly return a single status message, AJAX interactions allow multiple operations with multiple status that have to be notified to the user in the same interface and, preferably, in the same place. The notification system allows you to set 'cumulative' notifications to the user over the tabbed page main menu.
There are three types of notifications: info, warning, and error. These three keywords will be used to classify each notification message. There are three methods to do it.
Sending notification messages through an action
$this->getUser()->info('This is the notification used for successful transactions.');
$this->getUser()->warn('I have fixed a syntax error and I notify it to the user.');
$this->getUser()->error('I have found an error and I was not able to continue with the task.');
Sending notification messages through JavaScript? and jQuery
$(document).trigger('NotificationEvent', { type: 'info', message: 'This is the notification used for successful transactions.' });
$(document).trigger('NotificationEvent', { type: 'warning', message: 'I have fixed a syntax error and I notify it to the user.' });
$(document).trigger('NotificationEvent', { type: 'error', message: 'I have found an error and I was not able to continue with the task.' });
As you can see, it is very simple.
If you have questions you can write me to: carlos (at) markhaus.com

