Url parameters in postNewDocument

Hi there.I have a parameter that I’m passing by url.

In an XPage, I can get that parameter in different fields using request.getUrlParameter.

The problem is that the same code does not work in the XPage’s postNewDocument event.

Am I doing something wrong here?

Is it supposed to work in the postNewDocument event?

And if not, is there a way to get that url parameter in the postNewDocument event?

Any help would be greatly appreciated.

Subject: Re: url parameters

I’ve had problems using getURLParameter, finding it usually returns nothing when run in beforePageLoad etc. I found some posts describing the same problem:

http://www.youatnotes.de/web/youatnotes/blog2.nsf/dx/first-thoughts-xpages.htm?opendocument&comments

I seem to remember it working fine if I was using getURLParameter in the body of an XPage, just not in e.g. beforePageLoad events.

An alternative can be found by checking out Declan’s XPages tutorial (link below). Get the CGI Variables jss file from the Taskjam template - this has the getURLParam function added that is not in the discussion database template. This works fine in beforePageLoad events and should work for you.

Regards

Paul

Subject: Thanks

Thank you Paul.I will try it…