0

I would like to run some server side JavaDcript.

However I would like to do that via jQuery since I am waiting for a AJAX request performed by jQuery.

The server side JavaScript may be on the onclick event for a button.

I wonder how I can initiate the onclick event via client side JavaScript?

Diosney
  • 10,520
  • 15
  • 66
  • 111
Patrick Kwinten
  • 1,988
  • 2
  • 14
  • 26

3 Answers3

0

There are many examples of triggering SSJS from a client. You will need to use

XSP.partialRefreshGet

or

XSP.partialRefreshPost

see here: XSP Partial Refresh

You can use then params property section to manage what gets executed in your SSJS.

Community
  • 1
  • 1
Newbs
  • 1,632
  • 11
  • 16
0

document.getElementById("#{id:ButtonID}").click();

0

Using jQuery in xPages is a little bit tricky. The Domino Server assigns a new dynamic name which contains colons to the field at run time. Colons are special characters in jQuery, so there is no chance to get a field by $('id'). You could use the class-name instead. If you want to use the id, have a look at this xSnippet provided by Mark Roden:

http://openntf.org/XSnippets.nsf/snippet.xsp?id=x-jquery-selector-for-xpages