Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Copying to clipboard without intermediate window
Copying to clipboard without intermediate window [message #1757817] Mon, 20 March 2017 09:40 Go to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 557
Registered: October 2012
Location: Bern, Switzerland
Senior Member
When using BEANS.get(IClipboardService.class).setTextContents("foobar");

A popoup window is shown in the browser in which the user again has to press Ctrl-C to copy the selected values into the clipboard.

Is there a way to have the javascript code directly insert this text into the user's clipboard without this intermediate popup window?
Re: Copying to clipboard without intermediate window [message #1757818 is a reply to message #1757817] Mon, 20 March 2017 09:47 Go to previous messageGo to next message
Matthias Otterbach is currently offline Matthias OtterbachFriend
Messages: 9
Registered: August 2015
Junior Member
Unfortunately currently it is not possible to copy the values directly into the clipboard due to security restrictions of the browser (writing directly to the clipboard from JavaScript is only possible in an "user action context", but because Scout UI handles a command from the server, this is not in an "user action context").

If you want to write directly to the clipboard you would have to create your own custom widget w/o using the ClipboardService. Within this widget you could write directly to the clipboard (as long as you write to the clipboard in an "user action context").
Re: Copying to clipboard without intermediate window [message #1757841 is a reply to message #1757818] Mon, 20 March 2017 14:52 Go to previous message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 557
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Thanks for your answer (even if it wasn't what I wanted to hear Smile
Previous Topic:[neon] jetty launcher with https
Next Topic:Session timeout issues
Goto Forum:
  


Current Time: Sat May 27 15:42:15 GMT 2017

Powered by FUDForum. Page generated in 0.04317 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software