1

I read this question. I need to do a clipboard system in my gwt web application.

ZeroClipboard there is no longer on GoogleCode, and i have downloaded it from GitHub, but this guide doesn't work. Any one can help me?

This is my situation:

Home.html (in the same directory i have ZeroClipboard.js and ZeroClipboard.swf)

<script type="text/javascript" src="ZeroClipboard.js"></script>

MyPage.java

   -
   -
   -
    final Anchor copy = new Anchor("Copy");
    copy.getElement().setId("copyId");
    glueCopy("Hello World");
    add(copy);

  }

 public static native void glueCopy(String text) /*-{
  var clip = new $wnd.ZeroClipboard.Client();
  clip.setText(text);
  clip.glue('copyId');
}-*/;

Nothing happen when i click the anchor.

Community
  • 1
  • 1
nap.gab
  • 451
  • 4
  • 19

1 Answers1

0

i have resolved the problem my self. Flash security policy doesn't permit the execute from localhost.

nap.gab
  • 451
  • 4
  • 19
  • @nap-gab can you elaborate a bit ? Struggling with the same problem. – koma May 15 '14 at 10:52
  • Simply add the flash file not from a local directory, but from a URL ( no file://zeroclipboard.swf , but http://localhost/zeroclipboard.swf for example) – nap.gab May 16 '14 at 15:16