I think there is an easier way:
<button
id="MyButton"
height="25px"
text="Forward"
width="100px"
x="20px"
y="20px"
onCommand="javascript:this._session.getRequestService().retrieveAndProce
ss('changeText.xal')"/>
I'll send a complete sample shortly.
__________________________________________________________
Michael Mikhaylov | Software Engineer
Nexaweb Technologies | www.nexaweb.com
781.345.5418 o | Skype(tm): michael.mikhaylov
"An Application Platform for the Productivity-driven Enterprise"
-----Original Message-----
From: Scott Boyd [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 28, 2008 4:06 PM
To: [email protected]
Subject: Using RequestService without writing an MCO
XAPers,
In some application development scenarios, I'd like to specify whether
or
not to generate a Synchronous or Asynchronous request, and whether or
not to
process the response. The RequestService API provides 4 methods to do
this,
but I don't want to write an MCO just to invoke one of these methods.
After looking at the DOM in firebug, I settled on this approach, but I
think
its too verbose, and I don't like having to be aware of the XAP
application
ID for XAL that is obviously being executed in the context of a single
XAP
application already.
<button height="25px" onCommand="javascript:
window.xapApplications.nxAjaxPlatformProject.getSession
().getRequestService().retrieveAndProcess('setButtonRed.xm')"/>
I tried window.xap.requestservice... but that doesn't work without the
clientSession object.
<button height="25px" onCommand="javascript:
window.xap.requestservice.RequestService.prototype.retrieveAndProcess('
setButtonRed.xm')"/>
What is the simplest way to access the clientSession object from any
component in the DOM without writing an MCO? Is there some global
variable
that I missed in firebug?
-Scott Boyd