Page 1 of 1

on closeField equivalent on ioS input fields

Posted: Sat Jun 19, 2021 5:46 pm
by bbalmerTotalFluency
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

Re: on closeField equivalent on ioS input fields

Posted: Sat Jun 19, 2021 6:13 pm
by Klaus
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

Re: on closeField equivalent on ioS input fields

Posted: Sat Jun 19, 2021 6:53 pm
by bbalmerTotalFluency
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.

Re: on closeField equivalent on ioS input fields

Posted: Sat Jun 19, 2021 7:12 pm
by bbalmerTotalFluency
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

Re: on closeField equivalent on ioS input fields

Posted: Sat Jun 19, 2021 7:39 pm
by Klaus
AHA! :-)

Thanks for the info!