SharePoint 2010 Cookbook: How to Use the Notification Area in SharePoint 2010

Beyond working with status information, you can also customize the Notification Area on the upper right-hand side of the screen below the Ribbon. The Notification Area helpfully tells users such useful information as that a page is loading, or that a save was successful.  Prior to SharePoint 2010, this sort of information was indicated a postback and page refresh. In this article, we will take a look at how to show a message in the Notification Area in SharePoint 2010.

Challenge:

How can I show a message in the Notification Area in SharePoint 2010?

Solution:

A Notification appears in a small text area which gets displayed at the top-right corner of the window, while performing actions such as saving a page, checking out a page, etc., and is similar to the notification Gmail users see when sending an email. The Notification Area is a simple text area with a pale yellow background and a dark yellow border, as shown in the screenshot below. This is a new feature in SharePoint 2010.

 

The Notification Area can display one or more messages. Depending on the setting, a message will either disappear automatically or be disposed the developer manually.

How to use it?

Working with the Notification Area is really easy. The SharePoint team has done great job and wrapped up all of the functionality into the SP.UI.Notify namespace.

The first function is the SP.UI.Notify.addNotification function which takes two arguments: the HTML message to be displayed and a boolean value that determines whether the message is sticky or not:

SP.UI.Notify.addNotification = function(message, bSticky) {
 
}

Sticky notification messages have to be disposed of manually calling the SP.UI.Notify.removeNotification function and passing the ID of the message to dispose.

For example, executing the following call:

var notifyId = SP.UI.Notify.addNotification("Do You Bamboo?", true);

The following sticky notification message will be displayed:

The cool thing about the notification messages is that they can contain HTML and allow you to include images or links to deliver richer feedback to the users.

 

Remove Notification Area

By default, notification messages disappear automatically after five seconds. This value is hard-coded and cannot be modified. However, you also have the ability to display sticky messages, and you may control when these messages disappear.

You can hide notification messages using the SP.UI.Notify.removeNotification message. The only parameter that it takes is the ID of the notification message to hide:

SP.UI.Notify.removeNotification = function(notifyId) {
 
}

Notification messages are a great way to deliver feedback to users, communicating the execution of an operation. The SharePoint 2010 UI API makes it extremely easy to use notification messages in your custom applications developed on the SharePoint platform.

 

Notes:

 

See Also: 


SharePoint

Applications

SharePoint apps are stand-alone applications that perform specific tasks on a SharePoint site. Apps can perform functions such as managing a discussion board or knowledge base, performing project management or time tracking tasks, or doing other workflow operations.

SharePoint

Product Suites

Experience greater power and savings by bundling our SharePoint apps and web parts.


Essentials


Essentials Plus


Bamboo Premier


Project Management Suite


Knowledge Management Suite


External User Manager


SharePoint

Web Parts

Extend SharePoint beyond its out-of-the-box capabilities by tailoring it to your requirements with Bamboo Solution’s growing portfolio of Web Parts. Web Parts are the building blocks of pages on a SharePoint site that can be used to customize the user interface and content of a site page. 

SharePoint

Product Suites

Experience greater power and savings by bundling our SharePoint apps and web parts.


Essentials


Essentials Plus


Bamboo Premier


Project Management Suite


Knowledge Management Suite


External User Manager


Office 365

Cloud Parts

Cloud Parts are functional components that extend your SharePoint environment whether it’s hosted, on-premises, or part of Microsoft Office 365. More than mere ports of existing software to the cloud, our Cloud Parts have been built from the ground up to take advantage of the best that the cloud has to offer.

SharePoint

Product Suites

Experience greater power and savings by bundling our SharePoint apps and web parts.


Cloud Parts Suite for O365/SP Onl.


Featured Services

SharePoint Health Check

A SharePoint Health Check will identify the causes of issues and risks associated with your specific environment, and is custom tailored to provide you with the best recommendations to optimize your SharePoint environment.

SQL Health Check

Document recommendations relating to performance, stability, availability, or a specific focus you request of your SQL Server database instances.

My SharePointXperts

The truth is that each SharePoint skill may not be a full time job for many organizations, and it is nearly impossible for one person to do everything you need – so augment your team with SharePointXperts; providing the skill sets you need when you need them!