How to Filter Calendar Plus Web Part

Are you, like me and thousands of other users, huge fans of Bamboo's Calendar Plus Web Part?  It's a fantastic product, isn't it?Big Smile  Providing the ability to:

Color code based on a specific choice value

Ability to view different calendar views of a list or library (a hand full of them are shown below)

Ability to define the display column in the calendar, and ability to defined additional columns to be displayed in tool tips.

Ability to connect to different sources, such as Lists, Libraries, SQL Table/View, and List Rollup Web Part.

 And many, many more features.

However there has been one request that takes a little more ingenuity to accomplish.  It has been a request to provide the ability of "real-time" filtering to their end users.  The "real-time" filtering is a drop down menu that allows users to select a specific value and as a result, only items that match that selection will be displayed.  Luckily our product has the ability to consume filters from other sources using an out-of-box feature called Web Part Connections.

Web Part Connections creates a link between two Web Parts, allowing them to pass or receive information from each other.  In this article, I will be providing you with 2 methods of how to pass filters into Calendar Plus Web Part using Web Part Connections.

Creating a custom list with the filtered values

The first option I am going to discuss is using a custom list to provide the filter values to Calendar Plus Web Part.  A visual example is below

In the above example, you will notice on the right side of the screen is Calendar Plus Web Part configured to an Event list.  On the left side of the screen is a custom list that has 5 items related to Event Types.  Each of these Event Types relates to a choice column in the Events list called Calendar Type.  When a user selects a specific Event Type by clicking a radio button, the Calendar Plus Web Part will then filter automatically to display only Events that match that Event Type.  In our example, only Daisy A - Vacation matches the Event Type Vacation.  Here are the steps to achieve this -

  1. Decide which columns you want to filter on.  You can filter on more than one column but in our example we will be using only one column filtering.
  2. Create a custom list in the same site as Calendar Plus Web Part.
  3. Relabel the column Title of the custom list to a more descriptive label as it will be shown to the end user as Event Types is shown above.
  4. Go to the page where Calendar Plus Web Part is deployed, and add the custom list you created to the page.
  5. Modify the list view Web Part as desired.
  6. When the list view Web Part is ready, click on the drop down arrow to display the Web Part edit menu of the list view Web Part while in Edit Page mode, select Connections -> Provide Row To -> Bamboo Calendar Plus Web Part

  7. A pop-up window will appear that will allow you to configure the connection.  The first window allows you to select the column from the list view Web Part that users would filter Calendar Plus Web Part on.

  8. When you click Next, a similar window will appear with all the columns that is consumed by Calendar Plus Web Part, here you would select the column that the list view Web Part would map to, in this example, Event Types maps  to Calendar Type.

  9. When you click Finish or Next the screen will refresh and radio buttons will appear next to the the values in the list view Web Part.

You have successfully created a connection between a list view Web Part and Calendar Plus Web Part.

Creating a Form Web Part to filter Calendar Plus Web Part

Using a list view Web Part has its advantages, for example, anyone can maintain the list of options in the custom list, however, most users are used to a drop down interface.  Luckily SharePoint out-of-the-box offers a Web Part in both WSS v3 and MOSS 2007 called Form Web Part.  Think of Form Web Part is like the Content Editor Web Part where it is a self contained, independent Web Part.

The Form Web Part offers 5 interface types

  • Text Box - Similar to Single Line of Text input box in Edit and New form, user can enter a value then click Go to invoke the request.

    A sample snipet of the code is as follows:
    <div onkeydown="BLOCKED SCRIPTif (event.keyCode == 13) _SFSUBMIT_"><input type="text" name="T1"/><input type="button" value="Go" onclick="BLOCKED SCRIPT_SFSUBMIT_"/></div>

    Where input type="text" defines that the Web Part displays a single line text field and name="T1" is the label used for Web Part Connection.  The code surrounding the these entries that is in blue controls the submit button Go.
  • Text Area - Similar to Multiple Lines of Text control in the Edit and New forms, users can enter text then click Go.

    A sample snipet of the code is as follows:
    <div onkeydown="BLOCKED SCRIPTif (event.keyCode == 13) _SFSUBMIT_"><textarea rows="2" cols="20" name="T1"></textarea><input type="button" value="Go" onclick="BLOCKED SCRIPT_SFSUBMIT_"/></div>

    Where textarea defines that the Web Part is to display a text box similar to multiline text field, rows= defines how high the text field is, and cols= defines how wide the text field should be.  The name= is the label used for Web Part connections.  Similar to Text Box control, the surrounding blue text controls the Go button.
  • Check Box -  Similar to Yes/No control in the Edit and New forms.

    A sample snipet of the code is as follows:
    <div onkeydown="BLOCKED SCRIPTif (event.keyCode == 13) _SFSUBMIT_"><input type="checkbox" name="C1" value="Vacation" Checked>Vacation?</br><input type="button" value="Go" onclick="BLOCKED SCRIPT_SFSUBMIT_"/></div>

    Where input type="checkbox" defines that the Web Part is to display a checkbox control, name= is the label used for Web Part Connection, and value= is the value passed to the Calendar Plus Web Part if the checkbox is checked.  The final attribute Checked, defines if the check box is checked by default, if the attribute says Unchecked then the check box is cleared by default.
  • Option Box - Similar to radio button option with Choice field in the New and Edit forms.

    A sample snipet of the code is as follows:
    <div onkeydown="BLOCKED SCRIPTif (event.keyCode == 13) _SFSUBMIT_"><input type="radio" value="Trade Show" name="R1">Trade Show</br><input type="radio" value="Vacation" name="R1" >Vacation</br><input type="button" value="Go" onclick="BLOCKED SCRIPT_SFSUBMIT_"/></div>

    Where input type="radio" defines the Web Part to display a radio button control, value= is the value passed to the connected Calendar Plus Web Part if selected, and name= is the name of the control.  If you have multiple radio button options, use the same name= value.
  • Drop-down/List Box - This option is special as it covers 2 different kinds of controls, one is a drop down menu shown on the left and a list box shown on the right.
     
    A sample snipet of the code is as follows:
    <div onkeydown="BLOCKED SCRIPTif (event.keyCode == 13) _SFSUBMIT_"><select size="2" name="D1"><option value="Trade Show">Trade Show</option><option value="Vacation">Vacation</option></select><input type="button" value="Go" onclick="BLOCKED SCRIPT_SFSUBMIT_"/></div>

    Where <select ... </select> defines the Web Part to use a select option control, name= is the name of the control used for Web Part Connections, and  size= defines how high the box should be, if 1 the Web Part displays a drop down, if greater than 1, that defines how many lines in the list box to display, if there are more options than lines, then the Web Part displays a scroll bar.  <option value=""></option> each individual option that is displayed to the user in the drop down or list box control.

After successfully configuring the Form Web Part as desired, follow the steps 6 - 9 in the above section Creating a custom list with the filtered values to connect the new Form Web Part to Calendar Plus Web Part, where on the first step instead of selecting a column, you are selecting the control name (i.e. name=).


Posted May 05 2008, 07:00 AM by Jeff Kozloff

Comments

Joe Hegedus wrote re: How to Filter Calendar Plus Web Part
on Tue, Jun 10 2008 3:35 PM

I used your method I could not get it to work completely. I got all the way thru step 9 and then noticed that none of the items from my original list appeared in my calendar.  The left hand web part appeared fine but no matter what I selected nothing appeared in the calendar.  All the connections seemed to work properly (steps 6 thru 9).  a) are there any tricks I missed?  b) is there a way to select mutiple items from the left hand selection list?   Thanks much for your time!

Jeff Kozloff wrote re: How to Filter Calendar Plus Web Part
on Wed, Jun 11 2008 10:39 PM

Hello Joe,

How are you utilizing Form Web Part, meaning which mode are you using?  As for the multiple selections, Form Web Part is unfortunately limiting as you can setup a mode to allow multiple selections but it will send the selcted option like this:

apple, orange, grape

Which is not useful for how columns store choices.  As of lately though I have begun playing around with the Filter Web Parts provided by MOSS 2007 which is a very powerful sweet of Web Parts with multiple types of interfaces.  One of which is choice field with multiple selection option, I am not sure if it handles multiple selection differently from the Form Web Part as of yet.  I'll take a look at this tomorrow and let you know.

Jeff Kozloff

Bamboo Solutions

Joe wrote re: How to Filter Calendar Plus Web Part
on Thu, Jun 26 2008 12:24 PM

Jeff, Sorry - I am not sure what you mean by "which mode are you using?".  Also - I read alot abut an "Event List" but cannot find a definition of such in Sharepoint.   Does that mean any list that has a date in it?  Thanks - Joe

Improving the SharePoint Calendar « The WorkerThread Blog wrote Improving the SharePoint Calendar &laquo; The WorkerThread Blog
on Fri, Jul 4 2008 10:32 AM

Pingback from  Improving the SharePoint Calendar « The WorkerThread Blog

Junoti wrote re: How to Filter Calendar Plus Web Part
on Tue, Jul 8 2008 10:37 AM

Using a Form Web Part, how would you clear the filter?

Jeff Kozloff wrote re: How to Filter Calendar Plus Web Part
on Wed, Jul 9 2008 1:20 PM

Hello Joe,

I beleive you have been speaking with our Support team directly.  After speaking with our Engineering and QA Team, there is a limitation of Web Part Connections where the target column in Calendar Plus you wan to filter on MUST BE either the Display column or a selected column for the Mouse Over Tool Tip.  This is because to assist in performance, we only load data for those columns, even though during the configuration of the Web Part Connections list all the columns of the selected list.  Sorry for the confusion.

Junoti,

I am not sure if there is a way to clear the Form Web Part filter, I will have to look further into this and get back to you.  Another option is if you are running MOSS 2007 Enterprise, the Filter Web Part series provides much more powerful selection of tools and has the ability to clear selections.

Jeff

Joe Hegedus wrote re: How to Filter Calendar Plus Web Part
on Wed, Jul 9 2008 1:28 PM

The problem I had was corrected when I included the field I was connecting to the web part in the "Display Column:".  Thanks to Bamboo support for that.

Now I would like to know how to select multiple filters.  Also - is it possible to select one filter(s) from one list and another filter(s) from another list(s)?

Thanks!

Joe Hegedus wrote re: How to Filter Calendar Plus Web Part
on Wed, Jul 9 2008 1:41 PM

One more question - once a user selects the multiple (or single) filter - is there a way of saving it?  so he can use it the next time he accesses the calendar (and not have to reselect again)?

John M wrote re: How to Filter Calendar Plus Web Part
on Sat, Jul 26 2008 9:29 AM

Is there a way to create a Form Web part linked to the calendar and have it show a logical OR of the filter values. When I create a multiple check box filter list in the form web part and choose more than one item it gives me no results.

Joe T. wrote re: How to Filter Calendar Plus Web Part
on Wed, Jul 30 2008 8:52 AM

When you have multiple departments or categories of activities, to assume that a user only wants to see all or one category seems a bit limiting.

Like others, I tried the "checkbox" Form Web Part and if I selected one checkbox. it worked just fine.  As soon as I selected two it didn't work at all, removing all event from the calendar.

Has anyone found a way to show two or more user selected selections at the same time?  Since the webpart can take the filter, has any thought been given to redesigning it to parse that filter?

Jeff Kozloff wrote re: How to Filter Calendar Plus Web Part
on Wed, Jul 30 2008 1:24 PM

Hello Joe Hegedus,

On your first question, ability to filter on multiple lists, unfortunately currently you are unable to.  In Internet Explorer interface when making a Web Part Connection, a Web Part can consume only one connection.  You can however, create multiple connections between various Web Parts using SharePoint Designer (SPD) 2007, however there is a currently limitation with Calendar Plus Web Part which SPD is not supported.

On your second question, ability to save a filter, unfortunately no, there is not an option to save a selected item with SharePoint out of the box Web Part Connections (this is limitation of SharePoint and not Calendar Plus Web Part) when using Form Web Part.  The Excel Services Filter Web Parts, do provide an option to make the first option default, however, I am afraid Calendar Plus Web Part is unable to consume Excel Services Filter Web Parts today.  I am not sure if this is a limitation of our product or a bug, but I do have a request into Engineering to review the issue and I will let you know when it becomes available.

Hello John M & Joe T.,

The way Form Web Part passes multiple selection is unfortunately not very useful.  Let us say you have options A | B | C and you selected A & C, the Form Web Part actually passes the string "A,C" to the connected Web Part, as a result, the mapped column for the connection on the consumer Web Part must have a value that matches "A,C".  As mentioned to Joe Hegedus, Excel Services provides a pretty nice suite of Filter Web Parts, unfortunately the Choice Filter Web Part in this suite, only AND options as well (and also as mentioned, currently Calendar Plus Web Part has a limitation where it is unable to consume information from Filter Web Parts Today).

Thank you all for your continued input.  I have passed it along to our Engineering and Product Management Teams for consideration in a future release.  I will let you know what I hear back from our teams.

Cesar wrote re: How to Filter Calendar Plus Web Part
on Mon, Aug 11 2008 10:26 PM

Hi there

I am trying to do something similar to what you have done in the example but with an additional level of detail.

Lets say I wanted to show all events belonging to the departament of the current user. I am trying to use the Current User Filter providing its data to a list web part showing users and departments and then I have connected this filtered webpart to the events webpart.

My problem is that the users webpart need to be clicked in the only row shown ( it has been filtered ) in order to send data to the connected webpart.

Any idea on how to force or set first row as the default row?

Josep wrote re: How to Filter Calendar Plus Web Part
on Mon, Sep 29 2008 5:03 AM

Is there any method to delete the "Go" button and capture the onclick event in each radio button??

I want a default radio button selected. I insert the Checked property in this radio button, but when I select another radio button and the _SFSUBMIT_ function makes the postback, the default radio button appears selected and not the radio I selected

George P. wrote re: How to Filter Calendar Plus Web Part
on Tue, Oct 7 2008 2:03 PM

I was wondering whether you ever found a way to clear a Web Form Part Filter.  Thanks.

PhalanxSender wrote re: How to Filter Calendar Plus Web Part
on Fri, Oct 17 2008 10:12 AM

George P:

I put a content editor webpart with a link back to the default.aspx as a "clear all filter" shortcut.  Put it above or below the filter list, turn off the chrome and title bar and it almost looks like it is part of the list.

Joe Hegedus wrote re: How to Filter Calendar Plus Web Part
on Sun, Oct 26 2008 10:51 PM

This is a question on the use of Bamboo Rollup web part and Bamboo Calendar Plus web part... I am (still) trying to somehow filter the Bamboo Calendar Web Part.  I downloaded the new version of Calendar Plus (Version Bamboo.CalendarViewExtended Version: 1.0.0.0 File Version: 2.5.56.0) which allows web part connections and I was able to connect a web part to the Calendar.  So - I thought I would use the Rollup web part, connect the Rollup web part to Calendar Plus, then use the filter option on the Rollup web part so that the Calendar would show only the filtered data.  It does not look like this works.  My question is - is it supposed to work?  If not, then using the Calendar Plus version 2.5.56.0, is there ANY web part I can connect to the calendar that will use the filtered data from the connected web part?  Thanks. (still trying).

Jeff Kozloff wrote re: How to Filter Calendar Plus Web Part
on Tue, Oct 28 2008 10:32 AM

Hello Joe,

If I follow you correctly, you have List Rollup Data View sitting, let say to simplify things, on the same page as Calendar Plus Web Part.  Calendar Plus Web Part has been configured to connect to this List Rollup Data View to display items in a calendar view.  You have applied some default or web part connection filtering on List Rollup Data View in hopes to relay the filtering to items displayed in Calendar Plus Web Part.  Unfortunately this will not occur and is by design.  When you connect Calendar Plus Web part to the List Rollup Data View, what is actually occuring is Calendar Plus Web Part is actually connecting directly to the List Rollup Data Control (this is the custom SP control that actual gets data from lists and libraries to be displayed) to improve performance.  The reason we are looking for a specific List Rollup Data View is to retrieve the CAML query that is within the Data View to retrieve appropriate lists, items with in the list (remember when you created the List Rollup Data View you selected a view with the list or entered some custom CAML, thus filtering items returned from the defined list, this is honored in Calendar Plus also) and which columns to display then pass it to the Data Control to get the results to display.

Hope this helps resolve any confusion you may have,

Jeff

About Jeff Kozloff

Jeff originally joined Bamboo Solutions in June of 1999 as a part-time Test Engineer (basically a gopher). He continued with Bamboo as a part time tester while obtaining my Bachelors of Science in Computer Science degree at Longwood University. Upon graduation in 2004, Jeff accepted a full time position at Bamboo as a Helpdesk Specialist and became Manager of the Helpdesk team in 2006. In October of 2007 until present, Jeff took a role as Project Manager in the Solution group bringing his in depth technical knoweldge of SP to Bamboo's customers.

Bamboo Solutions Corporation, 2002-2009