Jump to content

Problems paste clipboard Client


asapltda

Recommended Posts

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

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

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

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

  • 2 weeks later...
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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...