Showing posts with label iNotes. Show all posts
Showing posts with label iNotes. Show all posts

Saturday, 16 November 2013

iNotes calendar control - a good example to get started

In my previous blog post about the iNotes calendar control, I talked about some issues I was having with the iNotes calendar control which is part of the XPages Extension library. Yes, there are some issues, but to mke a long story short: the control is a great resource. If you want to learn more about this control, I can highly recommend to have look at the latest release of the TeamRoom Template which is deployed to your Lotus IBM Notes client.

If you want to learn more about the iNotes calendar control, check out the calendarView custom control.

BTW: On this control, I experience the same issue with the events as described here.

There is also a TeamRoom project available on OpenNTF (older version). And a demo video by Ed Brill demoing the TeamRoom template. The OpenNTF project description says:

This new TeamRoom OpenNTF 8.5.2 template has been built as a showcase application for the XPages Extension Library.  Approximately 80 different XPages Extension Library controls have been used in the construction of the TeamRoom OpenNTF 8.5.2 template, therefore making it a great learning resource on how to leverage the XPages Extension Library!

In my opinion this hits the nail on the head. This is excatly the reason why everyone learning developing XPages applications (beyond the entry level) should have a look at this template. Additionally this version of the TeamRoom template provides a much better Web UI. So your users might benefit from this template too :-)

Friday, 15 November 2013

XPages iNotes Calendar control - Events oddities

While working in one of our projects with the iNotes calendar control I experienced some oddities with the Events of this control. What I wanted to achieve is that some magic happens when clicking somewhere inside the control - e. g. opening the entry on which the user clicks... Should be pretty straightforward, I was thinking. Stupid me! As usual the devil's in the details.

I started by selecting the control and opening the events view and entered a simle JavaScript in the "onNewEntry" event. The script is supposed to show a message box after  clicking in an empty time slot.
 
In my case the result is that the event just doesn't get fired at all. I tested with FireFox, Google Chrome and even Internet Explorer. After some more testing and playing with the control I noticed an odd behaviour of Domino Designer:
As you can see on the Screenshot above, both events "onNewEntry" and "onOpenEntry" are marked blue which indicates, that there is some code in the event to be executed.  When I opened the "All Properties" view of the control to check the scripts there, I noticed that both events were empty, no script, nada, nil... Switching back to the events view, the scripts were there.





So that got me thinking. Once I entered the same code in an event from the "All Properties" view, the code is executed.

As far as I understand, the "Events" view is kind of buggy for at least this control. Besides the issue described above, I noticed that from the "Events" view I can enter CSJS as well as SSJS and Simple Actions. From the "All Properties" view, only CSJS can be used - and as far as I can see only CSJS is supported. Side note: I am using Domino Designer and Domino Server R 9.0.

 Lesson learned (again): All Properties is where you should do your work!The good news: as soon as you know how to work with this control, it works great :-)