How to set a sessionScope variable using client-side script?

I wonder if anyone can shed some light on how to set a sessionScope variable using client-side script?

I found one mention of how to do so on Keith Strickland’s blog site here: http://www.keithstric.com/A55BAC/keithstric.nsf/d6plinks/KSTD-842LWC

However, he is experiencing the same difficulties as I am (at least I THINK they’re the same!).

I have a function to update a sessionScope variable built into a server-side script library.

I then place a call to that function in the client script of a button on the page (e.g. #{javascript:doThis(‘new Value’);};).

Finally, I include the script library in my page resources.

After doing all this, the sessionScope variable is immediately set to ‘new Value’ when the page is loaded, and I can’t change it to anything else.

Does anyone have any alternative methods of changing a sessionScope variable using client-side script?

I’d sure appreciate some help with this one.

Cheers!

T.

Subject: AJAX?

  • dojo has a near-trivial way to run AJAX, I’d try calling something on the server with your updates. Hitting the server is the only way to get client data to appear there. Problem here, of course, is getting the server-side code to work with the correct session data, but I’m sure JSF has some way to do that as well. XPages, being JSF, can leverage that if Lotus doesn’t provide a wrapper object already.

  • It’s also possible you can do a “partial update”, which appears to be the XPages automagic AJAX, so they have access to session data.

Hope this helps…