Re: Copy to Clipboard

2009-03-25 Thread Kevin Tarn
Hi Harish,
I am sorry I was not aware of I had another version of code doing copy/paste
for FF. FF is complicate to support copy/paste due to user privilage
protection. In addition to your code below, you still need to follow FF's
requirement to open privilage of copy/paste:
http://www.mozilla.org/editor/midasdemo/securityprefs.html

If you only want to make your copy/paste working on TextBox, there is an
easier way. You can use below method to get any user selection:
public static native String copyFrom() /*-{
var sel = $wnd.window.getSelection();
return sel.toString();
}-*/;

And then insert the text string you got into your TextBox.

Kevin

On 3/25/09, Harish Nair  wrote:
>
> I got this code from web its still not working is there any change i should
> make to run and copy text to clipboard.
>
> public static native void copyFrom(String mytext) /*-{
> if (window.clipboardData)
> {
> // IE
> $wnd.window.clipboardData.setData('text', mytext);
> // Netscape
> }
> else if (window.netscape)
> {
>
> netscape.security.PrivilegeManager.enablePrivilege
> ('UniversalXPConnect');
> var clip =
> components.classes['@
> mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
> if (!clip) return;
>
> //
> var trans =
> Components.classes['@
> mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
> if (!trans) return;
>
> //
> trans.addDataFlavor('text/unicode');
>
> //
> var str = new Object();
> var len = new Object();
> var str =
> 
> Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsS
> tring);
>
> var copytext=mytext;
> str.data=copytext;
> trans.setTransferData("text/unicode",str,copytext.length*2);
> var clipid=Components.interfaces.nsIClipboard;
> if (!clip) return false;
> clip.setData(trans,null,clipid.kGlobalClipboard);
> }
> alert("Following info was copied to your clipboard:\n\n" + mytext);
>
> }-*/;
>
>
> -harry
>
> 2009/3/24 Harish Nair 
>
>> Hi Kevin,
>>
>> This is not working in FF where as its working very well in IE. Please
>> advice me how to do it on FF as the site is going to run on that.
>>
>> -
>> Harry
>>
>>
>> 2009/3/24 Kevin Tarn 
>>
>>> It was tested in IE and Firefox. I am not sure whether it works on Chrome
>>> or Webkit.
>>>
>>> Kevin
>>>
>>>
>>> On 3/24/09, Dmitry Sterinzat  wrote:


 Does it work only for IE or it's crossbrowser code?

 2009/3/24 Kevin Tarn :

 > You can try below JSNI methods:
 > public static native void
 copyFrom(com.google.gwt.user.client.Element
 > element) /*-{
 > $wnd.window.clipboardData.setData('text', element);
 > }-*/;
 >
 > public static native void
 pasteTo(com.google.gwt.user.client.Element
 > element) /*-{
 > $wnd.window.clipboardData.getData(element);
 > }-*/;
 >
 > Kevin
 >
 > On 3/24/09, Harry  wrote:
 >>
 >> Hi,
 >>
 >> My project is that user is enabled to copy the content of a text box
 >> and paste it on another form using 'Copy' button. Please advice how
 to
 >> do it as GWT is not support copying to system clipboard.
 >>
 >> Please help its important.
 >>
 >> Thanks
 >>
 >> Harry
 >>
 >
 >
 > >
 >




>>
>
> >
>

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-25 Thread alex.d

As far as i know there is no consistent way to copy to the clipboard
in all major browsers. It's forbidden in most of them for the good
reason. In FF you have to allow it in security preferences (somewhere
in about:config - similar to what you are trying to do for Netscape)
but you can't do it as a website - only as a user.

On 24 Mrz., 19:19, Harish Nair  wrote:
> I got this code from web its still not working is there any change i should
> make to run and copy text to clipboard.
>
> public static native void copyFrom(String mytext) /*-{
>         if (window.clipboardData)
>         {
>         // IE
>         $wnd.window.clipboardData.setData('text', mytext);
>         // Netscape
>         }
>         else if (window.netscape)
>         {
>
>         netscape.security.PrivilegeManager.enablePrivilege
> ('UniversalXPConnect');
>         var clip =
>         components.classes['@
> mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
>         if (!clip) return;
>
>         //
>         var trans =
>         Components.classes['@
> mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
>         if (!trans) return;
>
>         //
>         trans.addDataFlavor('text/unicode');
>
>         //
>         var str = new Object();
>         var len = new Object();
>         var str =
>         
> Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsS
> tring);
>
>         var copytext=mytext;
>         str.data=copytext;
>         trans.setTransferData("text/unicode",str,copytext.length*2);
>         var clipid=Components.interfaces.nsIClipboard;
>         if (!clip) return false;
>         clip.setData(trans,null,clipid.kGlobalClipboard);
>         }
>         alert("Following info was copied to your clipboard:\n\n" + mytext);
>
>         }-*/;
>
> -harry
>
> 2009/3/24 Harish Nair 
>
> > Hi Kevin,
>
> > This is not working in FF where as its working very well in IE. Please
> > advice me how to do it on FF as the site is going to run on that.
>
> > -
> > Harry
>
> > 2009/3/24 Kevin Tarn 
>
> >> It was tested in IE and Firefox. I am not sure whether it works on Chrome
> >> or Webkit.
>
> >> Kevin
>
> >> On 3/24/09, Dmitry Sterinzat  wrote:
>
> >>> Does it work only for IE or it's crossbrowser code?
>
> >>> 2009/3/24 Kevin Tarn :
>
> >>> > You can try below JSNI methods:
> >>> >     public static native void
> >>> copyFrom(com.google.gwt.user.client.Element
> >>> > element) /*-{
> >>> >     $wnd.window.clipboardData.setData('text', element);
> >>> >     }-*/;
>
> >>> >     public static native void
> >>> pasteTo(com.google.gwt.user.client.Element
> >>> > element) /*-{
> >>> >     $wnd.window.clipboardData.getData(element);
> >>> >     }-*/;
>
> >>> > Kevin
>
> >>> > On 3/24/09, Harry  wrote:
>
> >>> >> Hi,
>
> >>> >> My project is that user is enabled to copy the content of a text box
> >>> >> and paste it on another form using 'Copy' button. Please advice how to
> >>> >> do it as GWT is not support copying to system clipboard.
>
> >>> >> Please help its important.
>
> >>> >> Thanks
>
> >>> >> Harry
>
>
--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to clipboard using ZeroClipboard - Problem

2009-03-24 Thread Thomas Broyer



On 24 mar, 23:51, Chris  wrote:
> Hi all,
>
> I've been playing around with the ZeroClipboard 
> (seehttp://code.google.com/p/zeroclipboard/) but I did not manage to get
> it to work as of now. After having tried out different approaches /
> solutions from other users (for example 
> herehttp://code.google.com/p/zeroclipboard/wiki/IdeasAndSuggestions), I'm
> now asking you guys. =)
>
> I want to copy a calculated value *from within my GWT-application* to
> the clipboard so that I can use that value anywhere else using Ctrl-v
> (that's what ZeroClipboard is all about right? ;-) )
>
> I therefore put the corresponding code into my host html file
> (Application.html) of my GWT-app:
> 
>   
>     
>     Application
>
>      src="ZeroClipbaord.js">
>     
>         function copy() {
>                 var clip = new ZeroClipboard.Client();
>                 clip.setText('Copied!!!');
>                 clip.glue( 'buttonId' );
>         }
>         
>      src="GWTServlet.Application.nocache.js">
>   
>
>   
>      style="position:absolute;width:0;height:0;border:0">
>   
> 
>
> My corresponding Java source-code looks like this:
> public class Application implements EntryPoint {
>
>   /**
>    * This is the entry point method.
>    */
>   public void onModuleLoad() {
>           FlowPanel table = new FlowPanel();
>
>           table.getElement().setId("FlowPanel");
>
>           Button button = new Button("ClickMe to copy to clipboard");
>           button.getElement().setId("buttonId");
>           button.addClickListener(new ClickListener(){
>
>                 public void onClick(Widget arg0) {
>                         copyInJava();
>                 }
>
>           });
>           table.add(button);
>
>           RootPanel.get().add(table);
>   }
>
>         public native void copyInJava() /*-{
>             $wnd.copy();
>         }-*/;
>
> }
>
> ZeroClipboard works just fine when used in plain HTML to copy contents
> to the clipboard but I did not manage to get it to work from inside a
> GWT-application.
>
> I also used FireBug to debug and apparently there is some issue when
> creating the ZeroClipboard.Client() object. Nonetheless, when I run it
> in plain HTML, everything is fine so I assume that the issue is due to
> the fact that I'm using a GWT-app to get the job done.
>
> Does anybody have suggestions what the problem might be?

My understanding of ZeroClipboard is that your copy() function should
be called *prior* to clicking the button, so that ZeroClipboard can
overlay a transparent Flash movie over the button; when you click the
button, you actually click the Flash movie which copies the given text
into the clipboard (that's click-jacking).

So with your code, on the first click you "install" the ZeroClipboard
client and starting with the second click only you copy the text to
the clipboard.
--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Copy to clipboard using ZeroClipboard - Problem

2009-03-24 Thread Chris

Hi all,

I've been playing around with the ZeroClipboard (see
http://code.google.com/p/zeroclipboard/) but I did not manage to get
it to work as of now. After having tried out different approaches /
solutions from other users (for example here
http://code.google.com/p/zeroclipboard/wiki/IdeasAndSuggestions), I'm
now asking you guys. =)

I want to copy a calculated value *from within my GWT-application* to
the clipboard so that I can use that value anywhere else using Ctrl-v
(that's what ZeroClipboard is all about right? ;-) )

I therefore put the corresponding code into my host html file
(Application.html) of my GWT-app:

  

Application



function copy() {
var clip = new ZeroClipboard.Client();
clip.setText('Copied!!!');
clip.glue( 'buttonId' );
}


  

  

  


My corresponding Java source-code looks like this:
public class Application implements EntryPoint {

  /**
   * This is the entry point method.
   */
  public void onModuleLoad() {
  FlowPanel table = new FlowPanel();

  table.getElement().setId("FlowPanel");

  Button button = new Button("ClickMe to copy to clipboard");
  button.getElement().setId("buttonId");
  button.addClickListener(new ClickListener(){

public void onClick(Widget arg0) {
copyInJava();
}

  });
  table.add(button);

  RootPanel.get().add(table);
  }

public native void copyInJava() /*-{
$wnd.copy();
}-*/;
}

ZeroClipboard works just fine when used in plain HTML to copy contents
to the clipboard but I did not manage to get it to work from inside a
GWT-application.

I also used FireBug to debug and apparently there is some issue when
creating the ZeroClipboard.Client() object. Nonetheless, when I run it
in plain HTML, everything is fine so I assume that the issue is due to
the fact that I'm using a GWT-app to get the job done.

Does anybody have suggestions what the problem might be?

Cheers

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-24 Thread Harish Nair
I got this code from web its still not working is there any change i should
make to run and copy text to clipboard.

public static native void copyFrom(String mytext) /*-{
if (window.clipboardData)
{
// IE
$wnd.window.clipboardData.setData('text', mytext);
// Netscape
}
else if (window.netscape)
{

netscape.security.PrivilegeManager.enablePrivilege
('UniversalXPConnect');
var clip =
components.classes['@
mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
if (!clip) return;

//
var trans =
Components.classes['@
mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans) return;

//
trans.addDataFlavor('text/unicode');

//
var str = new Object();
var len = new Object();
var str =

Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsS
tring);

var copytext=mytext;
str.data=copytext;
trans.setTransferData("text/unicode",str,copytext.length*2);
var clipid=Components.interfaces.nsIClipboard;
if (!clip) return false;
clip.setData(trans,null,clipid.kGlobalClipboard);
}
alert("Following info was copied to your clipboard:\n\n" + mytext);

}-*/;


-harry

2009/3/24 Harish Nair 

> Hi Kevin,
>
> This is not working in FF where as its working very well in IE. Please
> advice me how to do it on FF as the site is going to run on that.
>
> -
> Harry
>
>
> 2009/3/24 Kevin Tarn 
>
>> It was tested in IE and Firefox. I am not sure whether it works on Chrome
>> or Webkit.
>>
>> Kevin
>>
>>
>> On 3/24/09, Dmitry Sterinzat  wrote:
>>>
>>>
>>> Does it work only for IE or it's crossbrowser code?
>>>
>>> 2009/3/24 Kevin Tarn :
>>>
>>> > You can try below JSNI methods:
>>> > public static native void
>>> copyFrom(com.google.gwt.user.client.Element
>>> > element) /*-{
>>> > $wnd.window.clipboardData.setData('text', element);
>>> > }-*/;
>>> >
>>> > public static native void
>>> pasteTo(com.google.gwt.user.client.Element
>>> > element) /*-{
>>> > $wnd.window.clipboardData.getData(element);
>>> > }-*/;
>>> >
>>> > Kevin
>>> >
>>> > On 3/24/09, Harry  wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> My project is that user is enabled to copy the content of a text box
>>> >> and paste it on another form using 'Copy' button. Please advice how to
>>> >> do it as GWT is not support copying to system clipboard.
>>> >>
>>> >> Please help its important.
>>> >>
>>> >> Thanks
>>> >>
>>> >> Harry
>>> >>
>>> >
>>> >
>>> > >
>>> >
>>>
>>>
>>> >>>
>>>
>

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-24 Thread Harish Nair
Hi Kevin,

This is not working in FF where as its working very well in IE. Please
advice me how to do it on FF as the site is going to run on that.

-
Harry

2009/3/24 Kevin Tarn 

> It was tested in IE and Firefox. I am not sure whether it works on Chrome
> or Webkit.
>
> Kevin
>
>
> On 3/24/09, Dmitry Sterinzat  wrote:
>>
>>
>> Does it work only for IE or it's crossbrowser code?
>>
>> 2009/3/24 Kevin Tarn :
>>
>> > You can try below JSNI methods:
>> > public static native void
>> copyFrom(com.google.gwt.user.client.Element
>> > element) /*-{
>> > $wnd.window.clipboardData.setData('text', element);
>> > }-*/;
>> >
>> > public static native void pasteTo(com.google.gwt.user.client.Element
>> > element) /*-{
>> > $wnd.window.clipboardData.getData(element);
>> > }-*/;
>> >
>> > Kevin
>> >
>> > On 3/24/09, Harry  wrote:
>> >>
>> >> Hi,
>> >>
>> >> My project is that user is enabled to copy the content of a text box
>> >> and paste it on another form using 'Copy' button. Please advice how to
>> >> do it as GWT is not support copying to system clipboard.
>> >>
>> >> Please help its important.
>> >>
>> >> Thanks
>> >>
>> >> Harry
>> >>
>> >
>> >
>> > >
>> >
>>
>>
>> >>
>>

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-24 Thread Kevin Tarn
It was tested in IE and Firefox. I am not sure whether it works on Chrome or
Webkit.

Kevin

On 3/24/09, Dmitry Sterinzat  wrote:
>
>
> Does it work only for IE or it's crossbrowser code?
>
> 2009/3/24 Kevin Tarn :
>
> > You can try below JSNI methods:
> > public static native void copyFrom(com.google.gwt.user.client.Element
> > element) /*-{
> > $wnd.window.clipboardData.setData('text', element);
> > }-*/;
> >
> > public static native void pasteTo(com.google.gwt.user.client.Element
> > element) /*-{
> > $wnd.window.clipboardData.getData(element);
> > }-*/;
> >
> > Kevin
> >
> > On 3/24/09, Harry  wrote:
> >>
> >> Hi,
> >>
> >> My project is that user is enabled to copy the content of a text box
> >> and paste it on another form using 'Copy' button. Please advice how to
> >> do it as GWT is not support copying to system clipboard.
> >>
> >> Please help its important.
> >>
> >> Thanks
> >>
> >> Harry
> >>
> >
> >
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-24 Thread Ian Bambury
How does that copy the text to the clipboard?
Ian

http://examples.roughian.com


2009/3/24 mikedshaffer 

>
> I second Nicanor's solution:  have the click event handler on the
> button move the text from the first textbox to the second one.  That's
> all copy does natively...
>
> Good luck.
>
> Later,
>
> Shaffer

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-24 Thread mikedshaffer

I second Nicanor's solution:  have the click event handler on the
button move the text from the first textbox to the second one.  That's
all copy does natively...

Good luck.

Later,

Shaffer

On Mar 24, 6:29 am, Nicanor Babula  wrote:
> Given the situation:
> [code]
> TextBox txtBoxSrc = new TextBox();
> TextBox txtBoxDest = new TextBox();
> [/code]
>
> I think the simplest way to copy the first textboxes text into the
> second is:
> [code]
> txtBoxDest.setText(txtBoxSrc.getText());
> [/code]
>
>
>
> Dmitry Sterinzat wrote:
> > Does it work only for IE or it's crossbrowser code?
>
> > 2009/3/24 Kevin Tarn :
>
> >> You can try below JSNI methods:
> >>     public static native void copyFrom(com.google.gwt.user.client.Element
> >> element) /*-{
> >>     $wnd.window.clipboardData.setData('text', element);
> >>     }-*/;
>
> >>     public static native void pasteTo(com.google.gwt.user.client.Element
> >> element) /*-{
> >>     $wnd.window.clipboardData.getData(element);
> >>     }-*/;
>
> >> Kevin
>
> >> On 3/24/09, Harry  wrote:
>
> >>> Hi,
>
> >>> My project is that user is enabled to copy the content of a text box
> >>> and paste it on another form using 'Copy' button. Please advice how to
> >>> do it as GWT is not support copying to system clipboard.
>
> >>> Please help its important.
>
> >>> Thanks
>
> >>> Harry- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-24 Thread Nicanor Babula

Given the situation:
[code]
TextBox txtBoxSrc = new TextBox();
TextBox txtBoxDest = new TextBox();
[/code]

I think the simplest way to copy the first textboxes text into the
second is:
[code]
txtBoxDest.setText(txtBoxSrc.getText());
[/code]

Dmitry Sterinzat wrote:
> Does it work only for IE or it's crossbrowser code?
>
> 2009/3/24 Kevin Tarn :
>   
>> You can try below JSNI methods:
>> public static native void copyFrom(com.google.gwt.user.client.Element
>> element) /*-{
>> $wnd.window.clipboardData.setData('text', element);
>> }-*/;
>>
>> public static native void pasteTo(com.google.gwt.user.client.Element
>> element) /*-{
>> $wnd.window.clipboardData.getData(element);
>> }-*/;
>>
>> Kevin
>>
>> On 3/24/09, Harry  wrote:
>> 
>>> Hi,
>>>
>>> My project is that user is enabled to copy the content of a text box
>>> and paste it on another form using 'Copy' button. Please advice how to
>>> do it as GWT is not support copying to system clipboard.
>>>
>>> Please help its important.
>>>
>>> Thanks
>>>
>>> Harry
>>>
>>>   
>> 
>
> >
>
>   


--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-24 Thread Dmitry Sterinzat

Does it work only for IE or it's crossbrowser code?

2009/3/24 Kevin Tarn :
> You can try below JSNI methods:
>     public static native void copyFrom(com.google.gwt.user.client.Element
> element) /*-{
>     $wnd.window.clipboardData.setData('text', element);
>     }-*/;
>
>     public static native void pasteTo(com.google.gwt.user.client.Element
> element) /*-{
>     $wnd.window.clipboardData.getData(element);
>     }-*/;
>
> Kevin
>
> On 3/24/09, Harry  wrote:
>>
>> Hi,
>>
>> My project is that user is enabled to copy the content of a text box
>> and paste it on another form using 'Copy' button. Please advice how to
>> do it as GWT is not support copying to system clipboard.
>>
>> Please help its important.
>>
>> Thanks
>>
>> Harry
>>
>
>
> >
>

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-24 Thread Harish Nair
Thanks Kevin, i'll use it and get back to u with findings.

-
Harish


"You can't strengthen the weak by weakening the strong." - Abraham Lincoln

2009/3/24 Kevin Tarn 

> You can try below JSNI methods:
> public static native void copyFrom(com.google.gwt.user.client.Element
> element) /*-{
> $wnd.window.clipboardData.setData('text', element);
> }-*/;
>
> public static native void pasteTo(com.google.gwt.user.client.Element
> element) /*-{
> $wnd.window.clipboardData.getData(element);
> }-*/;
>
> Kevin
>
>
> On 3/24/09, Harry  wrote:
>>
>>
>> Hi,
>>
>> My project is that user is enabled to copy the content of a text box
>> and paste it on another form using 'Copy' button. Please advice how to
>> do it as GWT is not support copying to system clipboard.
>>
>> Please help its important.
>>
>> Thanks
>>
>> Harry
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-24 Thread Kevin Tarn
You can try below JSNI methods:
public static native void copyFrom(com.google.gwt.user.client.Element
element) /*-{
$wnd.window.clipboardData.setData('text', element);
}-*/;

public static native void pasteTo(com.google.gwt.user.client.Element
element) /*-{
$wnd.window.clipboardData.getData(element);
}-*/;

Kevin

On 3/24/09, Harry  wrote:
>
>
> Hi,
>
> My project is that user is enabled to copy the content of a text box
> and paste it on another form using 'Copy' button. Please advice how to
> do it as GWT is not support copying to system clipboard.
>
> Please help its important.
>
> Thanks
>
> Harry
> >
>

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-23 Thread Harish Nair
I understand what you are trying to convey here, but I need a code so that i
the text from textbox gets copied to system.clipboad, by not using well
known ctrl-c, but my own copy button on the form.
Ctrl- c is more manul, and it should automated by pressing just the Copy
button.

-
Harry

2009/3/24 Jason Essington 

>
> That is browser default behavior. To copy selected text to the
> clipboard, press ctrl-c (windows / linux) or command-c (OS X) or
> select copy from the edit menu (all platforms). This is the same way
> that you would copy from any other application. To supply a
> nonstandard UI element to perform a well known task like that violates
> best practices, and annoys users.
>
> So, basically, you can do it the way everyone is used to (by pressing
> the well known "copy" key combination, or select from the well known
> edit menu location) or you can attempt to fabricate a nonstandard way
> using JSNI that is likely to be fragile and bug prone.
>
> -jason
>
> On Mar 23, 2009, at 11:28 AM, Harry wrote:
>
> >
> > Hi,
> >
> > My project is that user is enabled to copy the content of a text box
> > and paste it on another form using 'Copy' button. Please advice how to
> > do it as GWT is not support copying to system clipboard.
> >
> > Please help its important.
> >
> > Thanks
> > Harry
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-23 Thread Jason Essington

That is browser default behavior. To copy selected text to the  
clipboard, press ctrl-c (windows / linux) or command-c (OS X) or  
select copy from the edit menu (all platforms). This is the same way  
that you would copy from any other application. To supply a  
nonstandard UI element to perform a well known task like that violates  
best practices, and annoys users.

So, basically, you can do it the way everyone is used to (by pressing  
the well known "copy" key combination, or select from the well known  
edit menu location) or you can attempt to fabricate a nonstandard way  
using JSNI that is likely to be fragile and bug prone.

-jason

On Mar 23, 2009, at 11:28 AM, Harry wrote:

>
> Hi,
>
> My project is that user is enabled to copy the content of a text box
> and paste it on another form using 'Copy' button. Please advice how to
> do it as GWT is not support copying to system clipboard.
>
> Please help its important.
>
> Thanks
> Harry
> >


--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: Copy to Clipboard

2009-03-23 Thread obesga

I saw in this forums that this is a browser specific code...
try searching and using JSNI

Oskar

On 23 mar, 18:28, Harry  wrote:
> Hi,
>
> My project is that user is enabled to copy the content of a text box
> and paste it on another form using 'Copy' button. Please advice how to
> do it as GWT is not support copying to system clipboard.
>
> Please help its important.
>
> Thanks
> Harry
--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Copy to Clipboard

2009-03-23 Thread Harry

Hi,

My project is that user is enabled to copy the content of a text box
and paste it on another form using 'Copy' button. Please advice how to
do it as GWT is not support copying to system clipboard.

Please help its important.

Thanks
Harry
--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---