Copy to clibpoard

Hi there. I have to implement tool that provide save text to clipboard by click on button. I found class
com.haulmont.cuba.web.widgets.CubaCopyButtonExtension that provides such mechanism but it uses one more component (textfield or label) that provides text.

My problem is that there isn’t any textfield or something else, text provides from java code. Is there any way to implement logic I am looking for?

It’s a horrible kludge but you could use an invisible textfield or label, set its value, and then use the mechanism you mentioned.