I make extensive use of the XSP object's partialRefreshGet and partialRefreshPost functions to invoke interactions with the Domino XSP server. It's generally accepted that a Get is faster than a Post because there is no data updating to do, no data to collect etc.
But sometimess, I need to send a single transient value up to the server to influence the returning results. You can do this on a get through the combination of a params object in the options object sent to the partialRefreshGet, and then using context.getSubmittedValue() in your Server Side JavaScript.
To do this, you call XSP.partialRefreshGet() just like has been illustrated before, but you add a new object to your options object, called params. You'll want to add a name/value pair to the params object with the name $$xspsubmitvalue, and the value of your choice.
Fully coded, it would look like something like this:
(client side javascript code)
var refreshId=dojo.query('[id$="serverSideIdYouWantToRefresh"]')[0];
var mySubmitValue='whatYouWantToSendHere';
XSP.partialRefreshGet(refreshId, {
params: {
'$$xspsubmitvalue': mySubmitValue
},
onStart: function () {
alert('starting');
},
onComplete: function () {
alert('boo-yah!');
},
onError: function () {
alert('aww shucks cletus, it done don't worked');
}
});
Then, in your SSJS, you can retrieve your value, like this:
var mySubmittedVal = context.getSubmittedValue();
Happy Coding!