Any other way to pass values to an agent other than URL Parameter or field on context doc?

On previous versions of Domino I would pass information back to a WQS agent either by accessing fields on the context doc or as parameters on the url.

I am new to xPages and was wondering if there was a different way to have values for variables (that get set on the XPage client side) passed back and accessible to a LS agent called from the postSaveDocument event of the xPage?

Everything I have read about scoped variables shows how to set them client side and access/maniuplate them there, but not if/how they would be available in a LS agent back on the server.

Thanks…

Subject: No.

  • Agent options, particularly for LS, are essentially the same, except WQO & WQS are no longer available. Now you MUST use a parameter document, and it’s a non-trivial mess to do processing with LS in postOpenDocument. Obviously Lotus expects the entire world to ditch LS and recode everything in JS, for XPages, because that’s the only thing that works cleanly. Too bad the whole world can’t do that.

  • Scoped variables are 1) JS only. LS can not access them, and 2) server-side only. This second point isn’t relevant for postOpenDocument because that’s a server-side event, but it is relevant in that when writing your XPage you must pay very, very, very close attention to whether any given bit of code runs on the client or the server. It’s not always obvious which is which, at least editing in the Source tab.

Hope this helps…

Subject: a little late getting back to you but…

Thanks for the information. I keep feeling like there is some huge bit of information I’m missing regarding 8.5 and a design I’m trying to implement.

I don’t have any issues with JS, but if I’m stuck storing values in fields and posting, or using ajax it seems fundamentally not much has changed.

Thanks again…

Subject: You’re very welcome…

  • I squandered tons of time and multiple PMRs to figure this out. Someone should be able to take advantage of a short cut. Hopefully others will find this thread and also save time.

  • I have since recoded some of my LS to wrap it in AJAX and that seems to be the best solution for LS code usage, if that will work for you. If I have time, which is not likely, I will probably recode it all for AJAX. XPages make AJAX about trivial, except getting LS to parse what it gets from dojo.xhrPost, and getting dojo.xhrPost to recognize JSON from LS is more than a little frustrating. Once it’s working, however, a quick wrapper class for AJAX I/O and about any LS can be AJAX-ified for XPages.

Hope this helps…