Can a native LC text field be put above a mobileControl test field
Posted: 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
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