Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ajaxCall question
#1
Can someone explain the parameters in the ajaxCall functions?

Thanks

iw15.1.4
Reply
#2
function ajaxCall(ACallbackName, AParams, ALock);
Reply
#3
Is this what you are looking for?

http://docs.atozed.com/docs.dll/developm...015.1.html

Dan
Reply
#4
(09-10-2019, 06:38 PM)DanBarclay Wrote: Is this what you are looking for?

  http://docs.atozed.com/docs.dll/developm...015.1.html

Dan

Let me be more specific.   On the javascript call below the 3rd parameter is false.    What does this parameter control?

Code:
ajaxCall("Multiply", "&x=5&y=10", false, function(response) {alert("Result is: " + response);});
Reply
#5
Quoted directly from the link that Dan posted:

"Multiply" function can be called from JavaScript using something as:


ajaxCall("Multiply", "&x=5&y=10", false, function(response) {alert("Result is: " + response);});


In the above example, the callback function receives 2 parameters named x and y, and multiply them. The result is put into aResult parameter (which is an out parameter) The difference here compared to old versions is that aResult string is returned to the browser as is, i.e. the response will contain a string representing the result of the multiplication of x by y only, nothing else. This makes much easier to interface with existing JavaScript libraries which expect specific responses (e.g. JSON strings).

The forth type of callback (TIWCallbackProc3) is the most flexible one. It allows you to set the result directly using variable aResult (as above) or still use TIWApplication.CallbackResponse object (as in IW 15.0), or yet, bypass the response completely setting aHandled parameter to True. Setting aHandled to True means that the user code is responsible for creating the reponse. In this case, IntraWeb will skip the execution of callback response code completely.
Reply
#6
(09-10-2019, 10:01 PM)kudzu Wrote: Quoted directly from the link that Dan posted:

"Multiply" function can be called from JavaScript using something as:


ajaxCall("Multiply", "&x=5&y=10", false, function(response) {alert("Result is: " + response);});


In the above example, the callback function receives 2 parameters named x and y, and multiply them. The result is put into aResult parameter (which is an out parameter) The difference here compared to old versions is that aResult string is returned to the browser as is, i.e. the response will contain a string representing the result of the multiplication of x by y only, nothing else. This makes much easier to interface with existing JavaScript libraries which expect specific responses (e.g. JSON strings).

The forth type of callback (TIWCallbackProc3) is the most flexible one. It allows you to set the result directly using variable aResult (as above) or still use TIWApplication.CallbackResponse object (as in IW 15.0), or yet, bypass the response completely setting aHandled parameter to True. Setting aHandled to True means that the user code is responsible for creating the reponse. In this case, IntraWeb will skip the execution of callback response code completely.

Thanks for pointing it out.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)