Page 1 of 2
Native Input Text
Posted: Sat Dec 27, 2014 1:32 pm
by Youks
Hi All,
I've searched the forum for an info but couldn't unfortunately find a clear solution.
I'm adapting an app to Android and when using the Native InputText after pressing "Return"(Done or Whatever), keyboard disappears but the cursor still flashes in the field. I've tried "focus on a button or anything else with no result, also "send mouseUp" to any object as well. Strangely when i touch anything on the screen then the "focus" or the flashing cursor goes away.
Any Hint? Thx in Advance
Tested on real device (Note 4), Last LC 6.7.1 CE, Mac Yosemite.
PS: Lengthy explanation just for clarity purposes.

Re: Native Input Text
Posted: Sat Dec 27, 2014 5:08 pm
by jacque
Try "focus on nothing" .
Re: Native Input Text
Posted: Sat Dec 27, 2014 5:50 pm
by Youks
Thx Jacque but already tried with no joy!

Re: Native Input Text
Posted: Sat Dec 27, 2014 7:50 pm
by Dixie
I think Jacque is correct with her 'focus on nothing'... maybe try it like this..
Code: Select all
on keyboardDeactivated
focus on nothing
end keyboardDeactivated
Re: Native Input Text
Posted: Sat Dec 27, 2014 8:43 pm
by Youks
Thx Dixie but i have already used exactly the same code as yours with no results!

Re: Native Input Text
Posted: Sun Dec 28, 2014 8:37 am
by Youks
Does anyone has a working example on Android with the Native InputText with the Focus removed from the field when pressing 'Return" or when the 'keyboardDeactivated' message sent ?
Thx
Re: Native Input Text
Posted: Sun Dec 28, 2014 9:00 am
by jacque
I haven't looked at this for a while but try putting the focus command in a returnInField handler in the field script. If that doesn't work try setting the autoTab property of the field to true. Either of those should remove the focus from the field.
Re: Native Input Text
Posted: Sun Dec 28, 2014 9:22 am
by Dixie
Jacque...
I haven't looked at this for a while but try putting the focus command in a returnInField handler in the field script. If that doesn't work try setting the autoTab property of the field to true. Either of those should remove the focus from the field.
The poster is using native input fields...
Re: Native Input Text
Posted: Sun Dec 28, 2014 9:48 am
by Youks
Hi All,
I've found a workaround but not very elegant though in the card script :
on inputReturnkey
focus on fld "Whatever" --------------------(TraversalOn to True Already) so i can move from the native field
set the traversalOn of field "Whatever" of card "Menu" to false ----------Once there Remove its focus again
end inputReturnkey
on inputBeginEditing ------------------Setting Back the TraversalOn true so i can focus elsewhere again
set the traversalOn of field "Whatever of card "Menu" to true
end inputBeginEditing
Still the annoying part is that the keyboard message is triggered (notification bar) but keyboard not shown...........
i don't remember having to do all this stupid maneuver on iOS !!! I am sure there should be an easy way or it is just a bug!!!!!
Still investigating but any help is really appreciated! Thx
Re: Native Input Text
Posted: Sun Dec 28, 2014 10:05 am
by Dixie
Youks..
reading your last post, It seems that you are mixing LC fields with native input fields... for example you can't set the 'traversalOn' of a native field... maybe this is where your problems lie...
@Jacque.. Sorry about my post, I think you are understanding what is happening here more than I am..

Re: Native Input Text
Posted: Sun Dec 28, 2014 10:57 am
by Youks
Hi Dixie Not at All !!
I created a Native field from which i store a string. On exiting that native field, on its on "inputReturnkey" message i "Focus on" a created invisible field in the card with its traversalOn value originally set to TRUE.
The original issue was i could never remve the focus from the native field even after trapping the inputReturnkey" message.
Focus on Nothing couldn't do anything but this is something already known or maybe an issue from either my Note 4 or LC.
I'm not working at this stage with any LC input text field.
Re: Native Input Text
Posted: Sun Dec 28, 2014 9:52 pm
by jacque
Dixie wrote:@Jacque.. Sorry about my post, I think you are understanding what is happening here more than I am..

Nope, I was assuming LC fields, so you were right. ReturnInField wouldn't do anything in a native field. But using "focus on nothing" within the "inputReturnkey" handler seems like it should work. If it doesn't, maybe it's easer to just force a scripted click somewhere on the card:
That would simulate what happens when the user manually clicks out of the field. It does seem like there should be a way to remove the insertion point though. iOS offers the ability to disable a native field, which might do it, but that isn't available on Android.
Re: Native Input Text
Posted: Mon Dec 29, 2014 9:45 am
by Youks
Thx Jacque but this is very strange, when i apply "click" or "mouseUp" by code in a handler the code works but the focus remains on the native field but when i physically touch the screen (which is similar to the code in the handler) the focus is removed !??
Are there specific conditions to make the code remove the focus or should i report for a bug ?
Thx
Re: Native Input Text
Posted: Mon Dec 29, 2014 6:03 pm
by jacque
At this point yes, I think it's time to report it.
Re: Native Input Text
Posted: Mon Dec 29, 2014 6:33 pm
by Youks
Hi Jacque,
I gave up with the idea of using the Native Input Text on Android as for the time being managing the "focus" on it seems not to be working.
I'm using the LC fields which is ok for my app at this stage.
I will report it as a bug.
Once again many thanks Jacque & Dixie for your time, and to All our community I Wish you a Happy New Year !!
