Sunday, December 11, 2011

Creating ticker using JavaScript inside Lotus Notes client

I always felt that the power of JavaScript is Lotus Notes client is underrated. Some articles which do describe this are here and here. I realized this power when a some time back I had create a ticker that worked in Lotus Notes client. You can simply embed an Java applet in the form but, Java applet and Lotus Notes don't gel together very well. You also go for animated table, but then you there would be only specified number of entries (rows) which you be able to cycle through.

Using JavaScript to create a ticker is very similar to creating one for Web browser. To start off create two computed fields on your form - TickerURL & TickerText with their respective field names in their value.


Put an action hotspot around the field TickerText and write the following formula:
@URLOpen(TickerURL). Put the following JavaScript code in JS Header of form.


In the JS Header make sure you set the "Run" property to "Client".


In the onLoad event write the following code:


In the onUnload event write the following code:


Thats it!! You are done. Preview the form in Notes client and see every 2.5 seconds the ticker changing with links. Go ahead and modify the code to add more links, create more animations....

No comments:

Post a Comment