0

Copy/Paste buttons

asked 2010-07-17 13:47:09 +0800

diego898 gravatar image diego898
246 3

Hello,

I would like to add a copy and a paste button to a toolbar I have. How can I implement this "copying" and "pasting" in ZK?

Thanks!

delete flag offensive retag edit

9 Replies

Sort by » oldest newest

answered 2010-07-20 22:09:27 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Listen to the onClick event of the button and do whatever you would like to do.

link publish delete flag offensive edit

answered 2010-07-21 10:10:05 +0800

diego898 gravatar image diego898
246 3

I need help with the "whatever I'd like to do" part.

How do I add somethign to the "clipboard' and then "paste from the clipboard" ?

link publish delete flag offensive edit

answered 2010-07-22 03:46:11 +0800

RFSLUX gravatar image RFSLUX
75

Hi diego,

i think in reasons of security usually modern browsers like ie8 or ff3+ doesn't allow to copy something to the clipboard by code.
Only right-click+copy from user are allowed to copy something to the clipboard.
So it's no good idea to try to use the clipboard..

Best regards
Jörg

link publish delete flag offensive edit

answered 2010-07-24 17:45:32 +0800

diego898 gravatar image diego898
246 3

So how does fkeditor thnig do it?

link publish delete flag offensive edit

answered 2010-07-29 19:24:17 +0800

diego898 gravatar image diego898
246 3

can anyone provide any insight?

link publish delete flag offensive edit

answered 2010-07-30 08:52:11 +0800

vinhvo gravatar image vinhvo
369 3

since it is only client-side actions, why dont you use pure javascript : here. and use Clients.evalJavaScript() to copy.
BR,vinhvo

link publish delete flag offensive edit

answered 2010-07-30 11:16:17 +0800

diego898 gravatar image diego898
246 3

1. The link does work for me when I click "copy here"
2. How do I setup Clients.evalJavaScript() and refer to a component I creeated in ZK?

link publish delete flag offensive edit

answered 2010-07-30 15:55:49 +0800

vinhvo gravatar image vinhvo
369 3

like this:
<button label="Test" onClick='Clients.evalJavaScript("alert(findOrder);")'/>

link publish delete flag offensive edit

answered 2010-08-02 17:30:41 +0800

diego898 gravatar image diego898
246 3

How do I refere to a client i created in ZK?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-07-17 13:47:09 +0800

Seen: 296 times

Last updated: Aug 02 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More