How to Show a Notification in a Windows Azure Pack Management Portal Extension

 

Applies To: Windows Azure Pack

Notifications are the preferred way to alert users to events that are not based on operations the user initiated themselves. If the operation was initiated by the user, use Progress Operations instead. For more information, see How to Show Operation Progress in a Windows Azure Pack Management Portal Extension. Notifications can be simple one line informational messages or they can be more complex. For example, button actions with details text the user can view.

To show an Informational Message Notification

  1. Use the following code to show an informational message:

    Shell.UI.Notifications.add("Hello World!", Shell.UI.InteractionSeverity.information);
    

To Show Custom Button Actions Notification

  1. Use the following code to display a custom buttons actions with details text notification:

    var notification = new global.Shell.UI.Notifications.Notification(errorMessage, 
        Shell.UI.Notifications.Severity.error),
      actions = [
        Shell.UI.Notifications.Buttons.retry(function() {
          performOperation(item, context);
        }),
        Shell.UI.Notifications.Buttons.cancel($.noop)
      ];
    
    notification.setDetailsText(response.ErrorMessage);
    notification.setActions(actions);
    
    Shell.UI.Notifications.add(notification);
    

See Also

Performing Common Tasks in a Windows Azure Pack Management Portal Extension