Home > Notes & XPages > XPages: Eventparameters

XPages: Eventparameters

Here is another advice for the horror we call XPages.

In XPages you have, theoreticaly, the possibility to pass a parameter along with an event. Sounds quite useful, doesn’t it? Unfortunately, they don’t work properly. It wasn’t possible for me to pass on some eventparameters. They simply didn’t arrive at the target.

Here is a workaround:

You can pass the parameter clientside and use them serverside after the request:

var docId = new CGIVariables().getURLParam("documentId");

Here is a link to a quite useful library which I use from time to time in my XPages:10.lotus.com

I added the following function:

this.prototype.getURLParam = function (name){
   name = name.replace(/[[]/,"\[").replace(/[]]/,"\]");
   var regexS = "[\?&]"+name+"=([^&#]*)";
   var regex = new RegExp( regexS );
   var results = regex.exec( "?" + this.request.getQueryString() );
   if( results == null ) {
      return "";
   } else  {
      return results[1];
   }
}
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: