on closeField equivalent on ioS input fields

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bbalmerTotalFluency
Posts: 51
Joined: Mon Apr 06, 2020 1:19 pm
Location: Thailand
Contact:

on closeField equivalent on ioS input fields

Post by bbalmerTotalFluency » Sat Jun 19, 2021 5:46 pm

Hi:

Basically, my user is adding some data to a db either via a livecode app on a mac or on the iPhone. My user may have added that data before, so "on closeField", triggers my livecode app to check the database for similar (not identical) entries. Very, very useful.

I cannot for the life of me, work out how to replicate that functionality on iOS. Do ioS fields have scripts and messages like in livecode? If yes, how does one set the script and what messages can be used. If not - how does one get round that and replicate the functionality.

I marvel at the sheer elegance of livecode and have done all the way back to Hypercard.

Bruce

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: on closeField equivalent on ioS input fields

Post by Klaus » Sat Jun 19, 2021 6:13 pm

Hi Bruce,

since the virtual keyboard pops up when the user starts typing into a native (mobilecontrolcreate) input field,
maybe you can script the -> keyboardDeactivated in the card script?
Seems to me like a good alternative to the non-existent "closefield" message on mobile.


Best

Klaus

bbalmerTotalFluency
Posts: 51
Joined: Mon Apr 06, 2020 1:19 pm
Location: Thailand
Contact:

Re: on closeField equivalent on ioS input fields

Post by bbalmerTotalFluency » Sat Jun 19, 2021 6:53 pm

Thanks Klaus (especially for the speed of your reply on a Saturday).

Hmm, I think I am too used to the genius that is livecode and these days to unfamiliar with the other ways of programming.

So iOS input fields don't have the sort of cool callbacks that livecode has then. I appreciate touch is tricky in some ways compared to a mouse.

I saw "selectedObjectChanged" which could be used at the card level BUT it doesn't work on iOS. Do you know if iOS has any equivalent? Because if the user clicks out of one input field by "clicking" / touching another - I worry that the keyboard might never be deactivated.

bbalmerTotalFluency
Posts: 51
Joined: Mon Apr 06, 2020 1:19 pm
Location: Thailand
Contact:

Re: on closeField equivalent on ioS input fields

Post by bbalmerTotalFluency » Sat Jun 19, 2021 7:12 pm

Are I have just found

inputBeginEditing, inputEndEditing, inputTextChanged in the dictionary. These will substitute for on openField and on closeField and on textChanged - which is what I use mostly.

The above may help someone else.

Bruce

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: on closeField equivalent on ioS input fields

Post by Klaus » Sat Jun 19, 2021 7:39 pm

AHA! :-)

Thanks for the info!

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”