SnTT: XPages Blank Calendar Control (Part 1)
While at LotusPhere I was searching for a way to create a Calendar using XPages to try and duplicate a Calendar View in the Notes Client. As I've said earlier, I believe this was a big part of XPages that was left out or just forgotten about. Well, I finally broke down and tried creating a Calendar Control on my own. Well I can't really say I did it on my own as I used the tutorials over on Declan's site and I had to enlist some help from Declan to solve a problem with the first row of the calendar. So, without further ado, let's get into it shall we...
First I had decided that I wanted to do this with a table instead of spans as it makes sense to do it that way as in my eyes that's what a calendar is, a table. Also I wanted to be able to navigate the months with links at the top of the table and maybe in the future a dojo calendar control somewhere. I've listed all the steps here in the order that I did things, while this may not make sense to some people it's what made sense to me. I guess I probably should've listed these steps in the order that they fall within the code, but I figured it best to go about how I did it. At the end of the article I will include all of the source code so it's just a copy and paste afair.
NOTE: Seems some of the strings within this document in the text areas are being screwed with for some reason. I will place an example DB in the downloads section shortly. Of particular note, the <[CDATA[ tags should read <[










Comments
Date: 02/04/2010 07:57:57 PM
Name: Jeremy Hodge
Website: http://www.hodgebloge.com
Keith,
Thanks for sharing !! I was just going to start putting together something like this myself tomorrow, and you have provided a great start for me. Thanks again.
Date: 02/05/2010 07:04:06 AM
Name: John Mackey
Website: http://www.jmackey.net
Very nice Darren! I know I could use this. Thanks for posting it.
-John
Date: 02/05/2010 09:20:20 AM
Name: John Mackey
Website: http://www.jmackey.net
Keith, I apologize that I called you Darren.
-John
Date: 02/05/2010 10:32:34 AM
Name: John Palmer
Website: http://www.heyheyjp.com
Keith:
Just talking about lack of XPages calendar and our need for one and BANG - look what shows up! Nice start! Now to figure out how to JUST point it to a view and have it pop in the data.
Date: 02/05/2010 01:14:57 PM
Name: Paul Withers
Website: http://hermes.intec.co.uk/intec/blog.nsf
Great work, it's looking good. It was a topic I started thinking about before Christmas. The challenge I identified, as you say, is putting data in the boxes, scrolling if you have too many entries, allocating against times and ranges of times etc. At that point I decided it was something for another day!
After a tweet I was pointed in the direction of Flex as an alternative method of putting together a calendar view control (the example I saw was very rich in functionality), but again I never got round to investigating further to see how easy it was in that technology.