#1 2017-02-05 14:03:28

Kasito
Banned
Registered: 2016-08-05
Posts: 58

How to Paste by Button Click (and the new Copy, Cut and Paste events)

I have a Cordova build project with copy button and have been wonder how to make a button that would paste the copied content.  Is this possible?  and how do  I ?

Thanks in advance.

Offline

#2 2017-02-05 22:44:27

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: How to Paste by Button Click (and the new Copy, Cut and Paste events)

Hello kasito,

If we are talking about text input controls, why not simply set the value of such controls with the copied content? Or I am completely missunderstand what you wanted?

Anyway I am update right now App Builder in order to incorporate some Clipboard related useful stuff. May this can help you in some way too? Just let me know!

2017.10 (02/05/2017)

* Add the new Clipboard2 sample, which shown how to use the recently added Copy, Cut and Paste events into almost all input controls and the Textarea control.

* Add the new [Control.PastedText] variable, which is available in almost all input controls and the Textarea control inside the Paste event of this refered controls.

* Add the Paste event to almost all input controls and the Textarea control. This event allow us to maintain informed when the user paste some text into the refered controls.

* Add the Cut event to almost all input controls and the Textarea control. This event allow us to maintain informed when the user cut some text from the refered controls.

* Add the Copy event to almost all input controls and the Textarea control. This event allow us to maintain informed when the user copy some text from the refered controls.

Please, let me know if you have any further question!

Offline

#3 2017-02-08 21:13:21

Kasito
Banned
Registered: 2016-08-05
Posts: 58

Re: How to Paste by Button Click (and the new Copy, Cut and Paste events)

What I mean is to paste content that might be copied from a different app into my app which is build wth  AB.   I want users to be able to copy content from any app and paste into my app input box by a click of a button.

In summary. The app should b able to paste any value in the clpboard into an input box in my app.

Thanks.

Last edited by Kasito (2017-02-08 21:16:32)

Offline

#4 2017-02-08 22:28:35

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: How to Paste by Button Click (and the new Copy, Cut and Paste events)

Hello,

Kasito wrote:

What I mean is to paste content that might be copied from a different app into my app which is build wth  AB.   I want users to be able to copy content from any app and paste into my app input box by a click of a button.

In summary. The app should b able to paste any value in the clpboard into an input box in my app.

Thanks.

Then I think you need a Cordova's plugin to do that, if that plugin exists... That is. The user can paste text in our application editboxes without problems, but, not by own our buttons, but using the system's provided menu. Please, if you can found a plugin that you can use, share it here with us!

Offline

#5 2017-02-09 05:59:01

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: How to Paste by Button Click (and the new Copy, Cut and Paste events)

Kasito wrote:

What I mean is to paste content that might be copied from a different app into my app which is build wth  AB.   I want users to be able to copy content from any app and paste into my app input box by a click of a button.

In summary. The app should b able to paste any value in the clpboard into an input box in my app.

Thanks.


You mean you do not want to use the phone system(android or ios)'s own copy and paste,to fill the AB app?

I guess in that case,maybe the other apps should communicate with AB app with a server,would be a better way!


Joshua.Y

Offline

#6 2017-02-09 09:27:17

Kasito
Banned
Registered: 2016-08-05
Posts: 58

Re: How to Paste by Button Click (and the new Copy, Cut and Paste events)

Hi. Reg4App

Yes. I do not want to use the phone copy and paste option or process as many are novice on how to copy and paste n android phones.

I want a system where they can copy an sms content of the phone, and while they are in my app (AB). They should just click a button to paste the content n an input box.  That's all.

HOW DO I DO THIS?


Note. To copy within AB and paste witching AB is simple. He app sample has all of that. But my issue is the out of AB content to be pasted in AB with a click of a button in AB. Android app.

Offline

#7 2017-02-09 13:00:40

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: How to Paste by Button Click (and the new Copy, Cut and Paste events)

Hello to all,

Kasito wrote:

Hi. Reg4App

Yes. I do not want to use the phone copy and paste option or process as many are novice on how to copy and paste n android phones.

I want a system where they can copy an sms content of the phone, and while they are in my app (AB). They should just click a button to paste the content n an input box.  That's all.

HOW DO I DO THIS?


Note. To copy within AB and paste witching AB is simple. He app sample has all of that. But my issue is the out of AB content to be pasted in AB with a click of a button in AB. Android app.

In my humble opinion any Android's user knows perfectly how to paste content into an editbox. Maybe you can help a bit with an small text saying something like "To paste the number, tap in the above editbox and choose Paste from the contextual menu". In fact probably you no need to go so far: maybe a simple label or placeholder in the editbox is enough.

Anyone that can use a number in your app are perfectly capable to paste that number in the specified editbox. And, since trying to do other things implies problems (The system allow us to access the user's clipboard? With or without permissions? Is the clipboard content ready to be pasted? Is the data we expected?) I think we must think to keep simple here.

P.S. Just think on the phone application in android's devices. They have a button to paste the number into the appropiate editbox? No. Simply let the user to type the number or just paste it...

P.S.2. On the other hand, are you looking for some Cordova's plugin? Remember that, if a plugin doesn't exists, you may create your own one... or pay to some other developer to create it for you!

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.