Hi all,

I created a basic project that uses ZeroClipboard to copy text to the
clipboard and it works fine.

I then created a widget which has the same text box and button I used
in the project above. And it doesn't work...
The widget consists of a few elements, like a text box and radio
buttons, plus raw HTML added to the panel.

The text box and the button are displayed correctly. Using Firebug I
am sure that both ZeroClipboard.js and ZeroClipboard.swf are
accessible.

The text box has the correct ID and the on click event of the button
refers to the same ID  ( clip_text )

This is the HTML element which is added to the mainPanel

  private final HTML zeroClipboardHtml = new HTML
  (
      "<script type='text/javascript' src='/cms/cms/javascript/
ZeroClipboard.js'></script>" +
      "Copy to Clipboard: <input type='text' id='clip_text' size='40'
value=''/><br/><br/>" +
      "<button id='d_clip_button'>Copy To Clipboard</button>" +
      "<script language=''JavaScript'>" +
      "  var clip = new ZeroClipboard.Client();" +
      "  clip.setText( 'qwerty' ); " +
      "  clip.setHandCursor( true );" +
      "  clip.setCSSEffects( true );" +
      "  clip.addEventListener( 'mouseDown', function(client) { " +
      "  clip.setText( document.getElementById('clip_text').value ); "
+
      "} ); " +
      "clip.glue( 'd_clip_button' ); " +
      "</script> "
  );


ZeroClipboard.js and ZeroClipboard.swf are in the public folder.


Beginning to think it only works if added to the HTML of the page, and
not in the GWT project itself... Any idea?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to