In my first "How do you do" xpages learning series I learned how to execute client side simple Java Script on xpages , Thanks to Tim Tripcony who shared interesting work around.
Actually I was trying to execute existing LS dashboard agent on xpage using client side Java Script to draw a chart. Lets see how I've done,
1- Created a new JavaScript script library with client side JavaScript which contains my xmlhttp module to call Lotus Script agent.
2- I've my Lotus Script agent ready which have logic to build flash charts ( Fusion Charts )
3- Created button "Draw Chart" on xpage and added JavaScript function "drawChart()" which is inside my JavaScript library.
You might notice I've selected "Server" tab instead "Client" one , Just following Tim's advice.
4- Open source of xpage and add your Client side JavaScript library reference .
To add Server side JavaScript library reference instead of ".js" use ".jss" and clientSide="false"
5- As per Tim's advice add additional tags in source,
Here is my desire output on the web when button is clicked ,
Few days ago I was working on "Flex builder" and it's interesting to see xpages development is very similar to flex development. Those who knows either of these can accelerate really fast.
6- Switch to "Design" view of your xpage and notice now code is moved into "Client" tab ( though we have started with "Server" tab )
It's very common to see new articles and tips about xpages in planet Lotus every day. Today I thought to make myself familiar with xpages. To do so I thought to try with very popular and simple program alerting "Hello World" when xpage loads .
Here is what I've tried,
When I view my xpage on web got something like ,
I'm using 8.5.1 designer with 8.5 server . Any clue ?
Is it the right way to execute client side JavaScript on xpages ?