asapltda Posted October 22, 2019 Share Posted October 22, 2019 Good morning, I have problems making paste from the Client's clipboard. The copy is made in the client and when I paste it in unigui application the copy is not made. if the same is executed on the server the paste if it is copied to the application unigui application from the client, from the server if it works. What should be done to make the paste from clipboard to the client Link to comment Share on other sites More sharing options...
Sherzod Posted October 22, 2019 Share Posted October 22, 2019 27 minutes ago, asapltda said: I have problems making paste from the Client's clipboard. The copy is made in the client and when I paste it in unigui application the copy is not made. if the same is executed on the server the paste if it is copied to the application unigui application from the client, from the server if it works. What should be done to make the paste from clipboard to the client Hello, Do you mean using the ClipBrd module on the client side? If you mean it, then you cannot use the ClipBrd module on the client side. Link to comment Share on other sites More sharing options...
asapltda Posted October 24, 2019 Author Share Posted October 24, 2019 Thank you, yes, the user (client) needs to copy data found on an excel sheet to the unigui program with which he is in the browser, what would be the way to do it? Link to comment Share on other sites More sharing options...
azago Posted October 24, 2019 Share Posted October 24, 2019 i've used procedure TfRicercaPratica.UniFrameCreate(Sender: TObject); begin with bPaste, JSInterface do begin JSCode('async function uniPaste(input) { '+ ' const text = await navigator.clipboard.readText(); '+ ' input.setValue(text); '+ ' };'); JSAddListener('click', JSFunction('sender', UniEdit1.JSName + '.SetValue(navigator.clipboard.readText()); ')); end; end; in the sample UniEdit1 is the object for paste information When using is mandatiory to press in UniEdit1 key CTRL -V for paste data Link to comment Share on other sites More sharing options...
asapltda Posted October 24, 2019 Author Share Posted October 24, 2019 Azago, Thank you very much for your answer, but I have some questions to understand the code, which I do not know, point them in yellow, you could expand the information. procedure TfRicercaPratica.UniFrameCreate(Sender: TObject); begin with bPaste, JSInterface do begin JSCode('async function uniPaste(input) { '+ ' const text = await navigator.clipboard.readText(); '+ ' input.setValue(text); '+ ' };'); JSAddListener('click', JSFunction('sender', UniEdit1.JSName + '.SetValue(navigator.clipboard.readText()); ')); end; end; in the sample UniEdit1 is the object for paste information When using is mandatiory to press in UniEdit1 key CTRL -V for paste data Link to comment Share on other sites More sharing options...
Sherzod Posted October 25, 2019 Share Posted October 25, 2019 5 hours ago, asapltda said: which I do not know, point them in yellow, you could expand the information.... http://forums.unigui.com/index.php?/topic/7637-dbmemoselectall-and-dbmemocopytoclipboard/&do=findComment&comment=66771 Link to comment Share on other sites More sharing options...
asapltda Posted November 9, 2019 Author Share Posted November 9, 2019 On 10/24/2019 at 10:50 AM, azago said: i've used procedure TfRicercaPratica.UniFrameCreate(Sender: TObject); begin with bPaste, JSInterface do begin JSCode('async function uniPaste(input) { '+ ' const text = await navigator.clipboard.readText(); '+ ' input.setValue(text); '+ ' };'); JSAddListener('click', JSFunction('sender', UniEdit1.JSName + '.SetValue(navigator.clipboard.readText()); ')); end; end; in the sample UniEdit1 is the object for paste information When using is mandatiory to press in UniEdit1 key CTRL -V for paste data On 10/24/2019 at 10:50 AM, azago said: tks for your help uses uniGUIJSInterface; MyStringList.Text := Clipboard.AsText ; // IS OK Link to comment Share on other sites More sharing options...
azago Posted November 9, 2019 Share Posted November 9, 2019 Pay attention that it is not the same thing to use a browser in the same development window that you access from another PC. I use a virtual machine in the development environment and all the tests I always do by accessing from the external machine via ipaddress of the virtual machine and not through 127.0.0.1. This is to tell you that the clipboard function only works on the same physical machine so when it goes into production it doesn't work. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now