dkeene Posted February 28, 2020 Share Posted February 28, 2020 Hello I am trying to pass variables from the delphi form to unigui Javascript and back. I have successfully created a variable called 'CurrentX' and in the delphi unigui form i execute: Self.WebForm.JSInterface.JSAssign('CurrentX', [123456]); //some arbitrary number. Then, from a component's ClientEvents (ExtEvents) i can view the variable value via: fmMyForm.windows.CurrentX //value 123456. I can set this variable to another value from within the ClientEvents (ExtEvents) fmMyForm.windows.CurrentX=654321; My Question is: Back on the unigui form, how can I access this value? Thank you Doug Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 29, 2020 Share Posted February 29, 2020 Hello, 16 hours ago, dkeene said: My Question is: Back on the unigui form, how can I access this value? 16 hours ago, dkeene said: I can set this variable to another value from within the ClientEvents (ExtEvents) fmMyForm.windows.CurrentX=654321; One possible solution, simply use with ajaxRequest: fmMyForm.window.CurrentX=654321; ajaxRequest(fmMyForm.window, 'setCurrentX', [...]); Quote Link to comment Share on other sites More sharing options...
dkeene Posted March 1, 2020 Author Share Posted March 1, 2020 Thank you; if there is a Self.WebForm.JSInterface.JSAssign, should there not be an opposite method to retrieve the value? something like: Self.WebForm.JSInterface.JSRetrieve('CurrentX', [aVariable]); Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 1, 2020 Share Posted March 1, 2020 1 hour ago, dkeene said: Self.WebForm.JSInterface.JSRetrieve('CurrentX', [aVariable]); No... The action must be from the client side. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.