Wednesday, October 19, 2022

Modern browsers support for Copyclipboard functionality

Hi All,
In our GWT application we are using Java native method call for Copytoclipboard functionality. Please refer below code

public static native String getClipboardData()/*-{
if($wnd.clipboardData && clipboardData.setData){
return $wnd.clipboardData.getData('Text');
}
}
}-*/ 
public static native String setClipboardData(String data)/*-{
if($wnd.clipboardData && clipboardData.setData){
return $wnd.clipboardData.setData('Text',Data);
}
}
}-*/ 

So above code is working fine with IE browser but not working with modern browser. I know this is not GWT specific question, but I don't have much knowledge with Javascript, so anyone who knows Javascript, please help here.



--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/c7ebae01-b41f-440a-b4da-b6c1c91231e3n%40googlegroups.com.

No comments:

Post a Comment