List Web Part Configuration – There are no items to show in this view of the list. To add a new item, click "New".

What an imaginative message. While it’s technically true, it certainly does not drive the user to perform some sort of remedial action…

At my current gig, I’m setting up pages which are used to show people visually what a specific business process is, using Visio Services and Silverlight to dynamically render a Visio diagram which is linked to a “Process Step Detail” list, containing more information about the process step and links to the relevant systems / people.

The problem here was that when the page first loads, no Visio object is clicked and as such, the message in the title appears:

There are no items to show in this view of the “Process Step Details” list. To add a new item, click “New”.

Exciting, isn’t it. However, it’s not very intuitive nor is it particularly helpful in describing WHY there are no items shown. For the pages that this web part appears on, the user is meant to click on an item in the Visio Diagram and the page will reload with further details about the specific step selected within the diagram… So to ensure the user gets the message, I created this JavaScript snippet to drop on any page that might contain a similar message, inviting the user to take action – In my case, the user is encouraged to click around on the Visio diagram’s objects to get more details.

<script>
function ChangeDiscussionMessage()
{

  var a = document.getElementsByTagName("TD")
  for (var i=0;i<a.length;i++)
  {
    if (a[i].className=="ms-vb")
    {
      if (a[i].innerText.indexOf("There are no items to show in this view")>-1)
      {
         a[i].innerHTML = "&nbsp;<b>&LT;--&nbsp;&nbsp;Please click on a process step in the diagram on the left to begin.</b>";
      }
    }
  }
}

_spBodyOnLoadFunctionNames.push("ChangeDiscussionMessage") 

</script>

 

Easy Peasy. With all of the little UI tweaks I’m doing currently, I’m starting to look seriously at leveraging something like Muhimbi’s SharePoint Infuser – http://www.muhimbi.com/blog/2009/07/massage-sharepoint-into-submission.html. I’ve certainly gained an appreciation for the flexibility JavaScript gives a hack like me when it comes to modifying the UI, and this Infuser makes it easy to drop the changes into place consistently across the Site!

Advertisements

About Brad Saide

I'm a SharePoint consultant. I'm also slowly going bald, seem to have a permanent spare tyre around my waist and enjoy socialising with friends over a beer or 10. The last 2 may possibly be related. Started working with SharePoint when the first version was in limited beta release (participated in the Technology Adoption Program while at Woolworths) and have been committed to the adoption of the technology as a business enabler ever since.
This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to List Web Part Configuration – There are no items to show in this view of the list. To add a new item, click "New".

  1. Vijay says:

    Good One…!!!

  2. Pingback: Process Diagrams – How useful are they? | SharePoint Blog

  3. KS says:

    Great idea! This snippet worked well for me 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s