How to copy text to Clipboard in GWT

2,692 views
Skip to first unread message

徐恒飞

unread,
Oct 12, 2009, 9:40:15 AM10/12/09
to google-we...@googlegroups.com
I can't find the method to copy text to Clipboard in GWT,

Is the GWT not support this method?

if it can't work in GWT, how can  it do in javascript

I know how to work in IE, but i don't know how to make javascript work in chrome?

how to use the javascript object Clipboard in chrome?

thank you!!!!

Mohamed Mansour

unread,
Oct 12, 2009, 10:16:16 AM10/12/09
to google-we...@googlegroups.com
Currently there is no way to do that in GWT. AFAIK people use Flash to handle copy to clipboard related actions. You can use this library:

Mohsen Saboorian

unread,
Oct 12, 2009, 10:16:22 AM10/12/09
to google-we...@googlegroups.com
It's not supported in all browsers. Even using this in IE is not safe, because this is usually disabled, or user is being asked from the user that website wants to change your clipboard.
Message has been deleted
Message has been deleted

Michael

unread,
Oct 13, 2009, 1:21:27 AM10/13/09
to Google Web Toolkit
You can use other approach: Show popup textbox with the text you want
user to be able to copy. Also, you can automatically make text
selection and point focus to the textbox.
So the only thing for user left to do is to press Ctrl+C, or use
context menu to put the text to Clipboard.

This approach used in our application ( http://www.projectkaiser.com:8080/pk
), you can take a look by pressing "Permanent link" button at the top-
left corner of any tab.
Reply all
Reply to author
Forward
0 new messages