Hi,
OK tested in Mac and Windows and I am still missing a reference or something. Here is the entire delegate:
Code:
//Call get_short_id(10) to get a 10 character pseudo guid
var m_guid = Lianja.evaluate("procs::get_short_id(10)");
txtpartnumber.text = m_guid; // assign to the textbox
if (Lianja.isDevMode()) { // Determine if in the Desktop or Web
Lianja.clipBoard(m_guid); // Lianja.clipBoard ONLY works in Desktop
} else { // In a Browser, try some Javascript...
txtpartnumber.select();
var copysuccess // var to check whether execCommand successfully executed
try{
copysuccess = document.execCommand("copy") // run command to copy selected text to clipboard
messagebox("Copy Worked")
} catch(e){
copysuccess = false
messagebox("Copy Failed")
}
}
You can tell this is test code, only a few lines if you discount the messageboxes and try/catch. Tested Mac on Safari (always the toughest) and Chrome, Windows on Firefox. No browser errors... Browser security requires an action from the user before allowing clipboard access. I thought calling a procedure might break this, so I added a "copy" button and since this delegate had already populated the textbox there was something to copy. The "copy" button delegate code is :
Code:
txtpartnumber.select();
document.execCommand("copy");
No error correction, comments. Still, not working. I am missing a reference or something? Ideas?
Thanks - James
Bookmarks