Can a native LC text field be put above a mobileControl test field

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:

Can a native LC text field be put above a mobileControl test field

Post by bbalmerTotalFluency » Sun Jun 20, 2021 4:56 pm

Hi:

I need to know when the mobileControl input field is clicked. I've tried using inputBeginEditing in the card that created the control - no result. I've tried putting an LC field above the mobileControl so i can register the click run some code then hide the field so that the mobileControl can receive the text including pasted results (which I notice the LC field cannot do).

I'm concerned that if this goes on much longer, I won't have any more hair to pull out. Is there a solution to my problem? It appears that mobileControl "input" theoretically responds to getting the focus, to losing it and to textChanges - which would cover most of what I need - but in practice, it does not seem to trigger the code on the card. And even if it did, my card generates three mobile controls and I wouldn't know which one triggered the code.

I have a nasty feeling that LC fields cannot be put above mobileControls - in which case, how do other people manage a similar problem. I could use a button for the user to click to do what I am trying to do but it is very inelegant compared with on closeField or inputEndEditing (theoretically).

If I may leave you with one last thought - arghhh! Ok, one more. Ouch!

Bruce

QUICK EDIT / UPDATE - I just got inputEndEditing working (thank fully). The code that creates the control must be on the card you want to receive the message - I thought it was OK for it to be the card that called the command I use to make the controls. I was wrong about that. And I can now find out which mobile control sent the message - so this now works (I mention this here for anyone who wants the same solution

on inputEndEditing
#ios only
if mobileControlTarget() = "question" then answer "yippee!"
end inputEndEditing
Last edited by bbalmerTotalFluency on Sun Jun 20, 2021 5:11 pm, edited 2 times in total.

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

Re: Can a native LC text field be put above a mobileControl test field

Post by Klaus » Sun Jun 20, 2021 5:03 pm

Hi Bruce,

the -> mobileControlTarget function could be of help here!

And yes, all native mobile controils are some kind of overlay over the stack
so you cannot put any LC object on top of them.


Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”