Skip to Content
0

How to get copy command after clicking on a link in sapui5?

Apr 12 at 09:39 AM

36

avatar image

Hi,

I am working on SAPUI5. I have json data with three text fields. If I click on a link on table, it should copy JSON data. and we can paste it anywhere. How to do this in sapui5?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Irfan Gokak Apr 12 at 12:06 PM
0

Hi,

Below code will work for you.

function myFunction() {
  var copyText = document.createElement("input");
  copyText.value = "Your text here";
  document.body.appendChild(copyText);
  copyText.select();
  document.execCommand("Copy");
  alert("Copied the text: " + copyText.value);
}
Show 2 Share
10 |10000 characters needed characters left characters exceeded

yeah. Thanku. its working now. I did some mistake that time

0

Thanks for tutorial ....

smile2.png (399 B)
0
Desiree Matas
Apr 12 at 10:44 AM
0

Hello Preety,

Could you provide us with some more details on what you are trying to do? Do you want to display data from a JSON model in a table, copy it to some other place? It is not clear from the description what you really want to do. The SAPUI5 version and controls you are using are also useful to help you.

Best regards,

Désirée

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi,

I have a table. All the data in table is fetching through json. There is one field in table called copy link. If I click on link only particular data from JSON should copy, so that if I paste somewhere, the copied JSON data should come.

0