I’m new to Xpages and for the life of me can’t figure out what I’m doing wrong here.
I am setting a sessionScope variable in the beforePageLoad event of an xpage and then trying to retrieve its value in some SSJS. On a web browser it all works perfectly, but on a Notes Client I get “undefined” for my value.
I’m not aware of any problems wih setting sessionScope variables in beforePageLoad. I tried setting a scoped variable in beforePageLoad and I can see it set. What is your code?
If you don’t already use it, I recommend following Declan Lynch’s suggestion for a debug panel Advanced XPages : Debugging Scoped Variables | Dec's Dom Blog. I use it in all applications, showing if I’ve set a sessionScope variable called showDebug to true.
The code looks okay, but I notice that your protocol variable for Notes is set to ‘"Notes//’, i.e. you have a double quote inside the single quotes. Is that the problem?
It certainly seems to be identifying Notes and web okay on 8.5.1.
Once you’ve got it working, you might want to look at how the XPages wiki sets such session-based variables through a function in a script library, so it’s only set once per session. Though I ppreciate that’s a luxury at the moment.
For some reason, it’s working today. Who knows why… And yes, you are right about that typo of extra quotes. Thanks for pointing that out. It was actually working even with that, so go figure.
i think that in the client environment session variables does not exist. Since the 4.x notes releases need to use @environment to simulate session variables in client.
there are new features with domino 8.5.1 about the client session variables ?