CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Copy to clipboard button

General discussion

by magosk » 16 Sep 2016 12:10

Hi!

I have a IWCGJQM-based page where I would like the user to be able to click a button in order to get a text from some kind of edit field copied into the clipboard. The target is iOS and Android mobile browsers and inexperienced users that may have trouble selecting and copying text manually. Is there an easy way to do this with your JQM controls? An example would be much appreciated.

When I searched the net for other solutions, I found e.g. https://clipboardjs.com/. Is something like this easy to incorporate into your page if there is no easy way using the IWCGJQM controls? I have unfortunately basically only worked with the web through IntraWeb, so it is not obvious to me how you would do it.

Best regards

Magnus Oskarsson
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41

by Jorge Sousa » 19 Sep 2016 10:42

Hello

Unfortunatelly you cannot PASTE in most browsers (maybe all except IE), only COPY

As you can see in many references:

http://stackoverflow.com/questions/6413036/get-current-clipboard-content

http://zeroclipboard.org/

including

https://clipboardjs.com/
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by magosk » 19 Sep 2016 11:47

Hi Jorge and thanks for your reply!

Sorry if I was unclear in my question, but I only want the copy function, not paste (that part will take place in an app). So my question remains: I want a button click to copy a text to the clipboard. How do I do this on my IWCGJQM page?

/Magnus
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41

by Jorge Sousa » 19 Sep 2016 12:06

Hi Magosk

Since many things in the web programming have cross compatibilty risks, mainly when we include mobile browser, i purpose the following agreement:

I'll make you an iW/CGDevTools demo using this method:

https://jsfiddle.net/jfriend00/v9g1x0o6/

You test it in your target mobile browsers

And if all succeeds we add the method to our framework

How does this sounds to you?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by magosk » 19 Sep 2016 12:34

Hi Jorge and thanks for your offer, it sounds great! Just so I understand you correctly, is this what you mean:
1. You create an IntraWeb/CGJQM demo app with some custom javascript code incorporated for the copy to clipboard functionality.
2. I build and test this application with various iOS and Android devices we have and let you know the result.
If successful:
3a. I will hopefully be able to build a first version of my web page by following your example (I need to have something working as soon as possible).
3b. You incorporate the functionality into one (or more) of your IWCGJQM controls
4. Once released, I can modify my web page to a simpler version that now uses built-in IWCGJQM functionality.

/Magnus
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41

by Jorge Sousa » 19 Sep 2016 15:48

Hello Magunus

1. You create an IntraWeb/CGJQM demo app with some custom javascript code incorporated for the copy to clipboard functionality.



Yes

2. I build and test this application with various iOS and Android devices we have and let you know the result.
If successful:


You don't need to create another application, just test in the most mobile os's possible

3b. You incorporate the functionality into one (or more) of your IWCGJQM controls


Yes, but it's only a general procedure CopyToClipboard(AControl: TIWCGJQControl)

4. Once released, I can modify my web page to a simpler version that now uses built-in IWCGJQM functionality.


Exactly
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by magosk » 19 Sep 2016 15:58

Great! Let me know when and how to obtain the test application.

(Regarding 2: I meant "build the IW application you created, then test this with various mobile browsers".)

/Magnus
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41

by magosk » 22 Sep 2016 14:40

Hi Jorge!

Any progress with the demo application?
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41

by Jorge Sousa » 22 Sep 2016 15:46

hello

Not yet, sorry, only next week
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by magosk » 03 Oct 2016 09:55

Hi again. Any update on the demo?

Note: if you look at our account (regarding support/license), we just updated our site license today (on the last day of the old license). I guess this purchase might take a while to be processed.

Best regards

Magnus Oskarsson
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41

Next

Return to General

Who is online

Users browsing this forum: No registered users and 3 guests

Contact Us.