0
votes

It seems a problem from long time and I am not able to find an alternative to this. I have an extension library calendar on my xpage and "onNewEntry" event I would like to create an entry in the existing document, however, the problem is that it only supports CSJS (Client Side Javascript) and ignores all SSJS (or runs them on page load). Can anyone please suggest an alternative to this?

Thanks.

1

1 Answers

1
votes

You're right that because the Extension Library calendar control is basically just a wrapper around the iNotes calendar (which is traditional Domino web and not XPages), it just accepts CSJS.

There are (at least!) a couple of options.

1) The best practice approach would be to use a JSON RPC call. This allows you to run SSJS from CSJS and use a callback to get the result. See Extension Library book pp351 onwards.

2) The quick and dirty option would be to add a button on your page with style "display:none" and add your SSJS in its onclick method. Then use #{id:myButton} in your CSJS to enable you to get the runtime client-side ID of the button and call its onclick method.