Web clipboard

  1. 6 years ago

    Mark P

    29 Apr 2014 Colorado

    I would like to enable a user to right-click copy something from anywhere on their desktop and then go to my webapp where I can extract the contents of the desktop clipboard without the user having to go through the right-click or cntl-v process. Is there somewhere in Xojo-web that allow me to grab the clipboard content like what exists in the desktop version?

    Being able to manipulate the data as it's coming in, I suppose. We could (for instance) just send the clipboard content directly to the server, where you'd parse it and return it in some other way to the user without them seeing their pasted data. There's also Cut and Copy operations, so you might be able to do something with those as well.

  2. Greg O

    29 Apr 2014 Xojo Inc scout.galaxy.barn

    We don't have a Clipboard class for the web, although there is a feature request for it.

    To be clear, if/when we do have a clipboard class, the browser user will still need to paste the text. Javascript is not allowed to get the clipboard text unless there's a Paste event in progress.

  3. Mark P

    29 Apr 2014 Colorado

    Thanks for the quick response. So, my users can already CNTL-C on the desktop and then CNTL-V in my web app. What is the key benefit of the web-clipboard feature then?

  4. Greg O

    29 Apr 2014 Xojo Inc Answer scout.galaxy.barn

    Being able to manipulate the data as it's coming in, I suppose. We could (for instance) just send the clipboard content directly to the server, where you'd parse it and return it in some other way to the user without them seeing their pasted data. There's also Cut and Copy operations, so you might be able to do something with those as well.

  5. Mark P

    29 Apr 2014 Colorado

    Thanks.

  6. @Mark P Thanks for the quick response. So, my users can already CNTL-C on the desktop and then CNTL-V in my web app. What is the key benefit of the web-clipboard feature then?

    If you don't want the end user to have to click a button or do anything other then cntrl-V just attach your processing to the TextChanged event for the field they paste into.

  7. 5 months ago

    Metodija A

    Feb 19 Testers, Xojo Pro

    Using JavaScript and populating text from clipboard into WebTextField (by taking the {ControId}_inner) actually works, but unfortunately ONLY on client side. Xojo property "Text" of the web text field remains as it was before.
    Any trick to set the text property?

  8. Michel B

    Feb 19 Testers, Xojo Pro

    You want to read WebControlSDK.pdf in the WebSDK folder, within the Extra folder, next to the Xojo executable.

    It will show you how to send back data to the app, in order to modify Text.

  9. 3 months ago

    Amy B

    Mar 29 Marietta, Georgia, USA.

    Is there any way to "press" a set of keys to create the effect of entering text into a Clipboard?
    I am displaying text on a ListBox and do not want to run into the problem of creating files with peoples' data on my server for users to download, so am going to have to display the text into a text field and actually have users hit Ctrl-A and Ctrl-C.... :/ ... or display the data in an HTML viewer. Blech.

  10. Greg O

    Mar 29 Xojo Inc scout.galaxy.barn

    @Amy B Is there any way to "press" a set of keys to create the effect of entering text into a Clipboard?
    I am displaying text on a ListBox and do not want to run into the problem of creating files with peoples' data on my server for users to download, so am going to have to display the text into a text field and actually have users hit Ctrl-A and Ctrl-C.... :/ ... or display the data in an HTML viewer. Blech.

    Unfortunately, since I originally answered this 6 years ago, a lot has changed with privacy and the browsers. Support for being able to arbitrarily copy into the users clipboard is now considered a security issue in many cases and the browsers will effectively prevent you from doing this. The thing they pretty much universally let you do is copy/paste text from/to a text field or text area.

  11. Amy B

    Mar 29 Marietta, Georgia, USA.

    Gotcha - I ended up using an HTMLviewer and custom code to display the data for the user to copy.

    https://realmakers.net/cgi-bin/ll1r2/ledgerlite1r2.cgi

  12. Amy B

    Mar 29 Marietta, Georgia, USA.

    *needed a quickie app to compile mileage and expenses while I am doing my taxes. :/

or Sign Up to reply!