08-16-2019, 07:32 PM
Hi:
I´m testing Intraweb 15.1 and
I need to get on server side (IWApplication) the result value from a javascript function executed on client side.
I have read this dodumentation http://docs.atozed.com/docs.dll/developm...015.1.html
and these threads https://www.atozed.com/forums/showthread.php?tid=498 , https://www.atozed.com/forums/thread-1134.html
Also IW CustomAjaxCall Demo.
But I find all very confusing, because i need the return values on server side.
So Why should I use a callback method, when all I need to do is to get a result value that is on the client side?
Also, I´m not sure if I got this right.
Here is what I have so far...
1- the CallBackMethod:
procedure TfrmBase.clbkGridSel(aParams: TStrings; out aResult: string);
begin
aResult := aParams.Values['Selection'];
end;
2 - the registration of the callback method
procedure TfrmBase.IWAppFormCreate(Sender: TObject);
begin
WebApplication.RegisterCallBack('clbkGridSel', clbkGridSel);
end;
How do I get, on server side, the aResult from the callback method to process this information?
I wrote this method to execute the callback on client side, but as you can see, It doesn´t help me to get the information.
function TfrmBase.GetSelecaoGrid: string;
begin
WebApplication.
CallBackResponse.
AddJavaScriptToExecute('ajaxCall("clbkGridSel", "&Selection=" + GRIDCADUSUARIOGetSelected()');
end;
GRIDCADUSUARIOGetSelected() id the javascript function that will return the selected data.
In other words, what I need to accomplish, is to be able to call javascript "GRIDCADUSUARIOGetSelected() " from Server Side, and get it´s result value.
I´m testing Intraweb 15.1 and
I need to get on server side (IWApplication) the result value from a javascript function executed on client side.
I have read this dodumentation http://docs.atozed.com/docs.dll/developm...015.1.html
and these threads https://www.atozed.com/forums/showthread.php?tid=498 , https://www.atozed.com/forums/thread-1134.html
Also IW CustomAjaxCall Demo.
But I find all very confusing, because i need the return values on server side.
So Why should I use a callback method, when all I need to do is to get a result value that is on the client side?
Also, I´m not sure if I got this right.
Here is what I have so far...
1- the CallBackMethod:
procedure TfrmBase.clbkGridSel(aParams: TStrings; out aResult: string);
begin
aResult := aParams.Values['Selection'];
end;
2 - the registration of the callback method
procedure TfrmBase.IWAppFormCreate(Sender: TObject);
begin
WebApplication.RegisterCallBack('clbkGridSel', clbkGridSel);
end;
How do I get, on server side, the aResult from the callback method to process this information?
I wrote this method to execute the callback on client side, but as you can see, It doesn´t help me to get the information.
function TfrmBase.GetSelecaoGrid: string;
begin
WebApplication.
CallBackResponse.
AddJavaScriptToExecute('ajaxCall("clbkGridSel", "&Selection=" + GRIDCADUSUARIOGetSelected()');
end;
GRIDCADUSUARIOGetSelected() id the javascript function that will return the selected data.
In other words, what I need to accomplish, is to be able to call javascript "GRIDCADUSUARIOGetSelected() " from Server Side, and get it´s result value.