AJAX SharePoint List Rotator WebPart

Sometimes, you want to rotate items out of a SharePoint list on a random basis in order to make this information available to your users, for example, some items that might be housed within your enterprise portal that would be helpful to rotate on something like your intranet frontpage displayed in no specified order are:

Technology Tips

Work Related Tips

Random Quotes

Company News

Upcoming Company Changes / Business Announcements

So, without further a due, a shocker of a WebPart, the AJAX Rotator WebPart.

The AJAX Rotator WebPart does what its name implies; it rotates things out of a SharePoint list. In order to eliminate a postback, it uses AJAX to load and rotate the items, nothing really fancy, but I needed a way to display task items randomly in a WebPart. To be honest I didn’t spend a lot of time on it because it was a nice to have thing, and not really used that heavily for my side project (I had under an hour to deliver it), so I just kinda whipped the damn thing out. It does take into account like object disposal etc., but I am sure some things could be cleaned up and other things introduced that would make it a little bit more applicable for other persons use. I dunno, I might be interested in doing something else with it, but hey, it was written on a whim really quick so I didn’t have the luxury of being that clever.

The AJAX Rotator WebPart is packaged within a SharePoint solution file (AjaxRotator.wsp) and the deploy.CMD file that will deploy your solution to your server. Once the solution if deployed, it is very, very easy to configure.

After successfully SharePoint Solution deployment On Your SharePoint Server:

Activate the SharePoint feature for the AJAX Rotator WebPart by going to the site collection features of the SharePoint instance by going to:

Site Actions -> Site Settings -> Site Collection Features -> activate the AJAX Rotator WebPart Feature

Once the feature is activated, add the WebPart to a WebPart page by going to Site Actions -> Edit Page

Once the WebPart is added, it must be configured by setting the WebPart properties, these are grouped under two sections, List Configuration and Labels and Message.

The first section is just the configuration options that are required, like the web where the list lives and the name of the list that should have its items rotated. There are some other configuration options that you can implement as well like if you want to pull a secondary field for display, and if there is a lot of characters that would normally be pulled from the secondary field, you can truncate that amount, if desired (you have to enable the truncation by selecting the checkbox). In this section you will also choose the rate of display that you would like items to be rotated in and out (I use 3000, but hey that’s just me).

The Labels and Messages section lets your adjust some of the textual interface components like the text that is used for the read more section, what text you want when items are loaded, etc. etc. etc They are pretty self explanatory.

I have only tested it with a task list, I haven’t tested it with any other types of lists. I am assuming because the code is kinda ambiguous it should work, but don’t get mad when it doesn’t. Like all the software that I release on this site, read the sharepointsecurity.com software disclaimer before you download it. (For those that don’t want to read it, it basically says this file and its parts is free for re-distribution, for use in both free and commercial applications, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.)
Anyhoo, you can download it here.

Share

31 thoughts on “AJAX SharePoint List Rotator WebPart”

  1. This looks like a great webpart. I followed the install and it went well. Only problem is when I try to add it to a Team site, I get this error:

    AJAX Rotator WebPart: Could not load file or assembly ‘System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

    Any thoughts? Thanks, I really hope I can use this web part. BTW, this is on a MOSS 2k7 Enterprise setup.

  2. The System.Web.Extensions assembly is crucial to using AJAX within your SharePoint environment, which I am unsure whether it has been installed into your environment.

    Here is a post that shows you how to install AJAX into your SharePoint environment.

    http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3

    It’s pretty simple, just install the AJAX package and then make some config changes, and you are ready to go. Here are some other links that target your error which I hope are helpful to you as well.

    channel9.msdn.com/ShowPost.aspx?PostID=293825
    http://www.thescripts.com/forum/thread586766.html
    forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1942896&SiteID=1

  3. I am using WSS 3.0 and try to deploy the AjaxRotator.wsp file but it said “The file you imported is not valid. Verify that the file is a Web Part description file (*.webpart or *.dwp) and that it contains well-formed XML”. So do you have any suggestion on the problems?

  4. Any update on releasing the source? This looks way useful but I want to alter the functionality slightly to make the item displayed changeable using a dropdown, rather than a random display

    Cheers
    Gavin

  5. Dear Sir/Madam,
    We have inhouse employees who have been working on .net with sharepoint.we will outsource these candidates to companies on contract basis.
    waiting for your speedy reply.

  6. Install went fine. However, upon configuration, could not get a response from any of the buttons (OK, Cancel, Apply) in the web part mod part. Any ideas?

  7. after adding the webpart & the list information , i was not able to see any output ,
    the webpart keeps on displaying “Loading….”

  8. I like the concept and would love to see the source code.

    The problem I’ve got is that the first list item is never shown and during the time it should show, it just displays “Loading” and then skips to the second listitem which it displays correctly. After that it just keeps rotating between the second and following items and never shows the first list item (or the “loading” message) again.

    Still, I would like to see the source code to see if I could fix it. I also would like it to work with Image libraries, as it doesn’t seem to be able to do so now.

    Thanks for your time.

  9. I like the web part… it does almost exactly what I need. However I need to change the information that is displayed, as well as the way it is displayed. Is there any way I can get the source code so I can modify it to meet our needs? Thanks in advance!

  10. Good webpart sir! Are you planning to release the code soon? I have noticed few other people have requested for the code. please let us know.

    Thanks

  11. after adding the webpart & the list information , i’m not able to see any output , the webpart keeps on displaying Loading…. im not sure if im missing something, can anyone help

  12. Hi Adam,
    This is a fantastic work! We’d would love to see the source code. Wondering when would it be realeased? It seems like Loke first reqeusted it a year ago.

  13. This seems to be doing the same thing one of the users was experiencing above on our server:

    “The problem I’ve got is that the first list item is never shown and during the time it should show, it just displays Loading and then skips to the second listitem which it displays correctly. After that it just keeps rotating between the second and following items and never shows the first list item (or the loading message) again.”

    Also, the AJAX seems to be refreshing the entire browser screen and not just the web part’s display.

    Any thoughts? I am using this web part with a Custom List and not a Task list, but I am going to try a task list just to see if it makes a difference.

Leave a Reply

Your email address will not be published. Required fields are marked *