Page 1 of 1

openField handler has no effect when entering an android native field widget (LC9.0.0 RC1)

Posted: Thu Mar 15, 2018 10:01 am
by drkosta
Hi there,

when I place an android native field widget on my card, I want the text which is in the field be deleted when entering this field. Everthing I tried did not led to desired result.

I even tried just with a simple script:

Code: Select all

on openField
answer "yeah"
end openField
the "textChanged" handler works like a charm.

Any ideas?

Best Regards

Kosta

Re: openField handler has no effect when entering an android native field widget (LC9.0.0 RC1)

Posted: Thu Mar 15, 2018 11:34 am
by LiveCode_Panos
Hi drkosta,

This looks like a bug to me.

Does the following serve as a workaround in your use case? (put it in the card script)

Code: Select all

on keyboardactivated
   set the text of widget "myAndroidField" to empty
end keyboardactivated
Best,
Panos
--

Re: openField handler has no effect when entering an android native field widget (LC9.0.0 RC1)

Posted: Thu Mar 15, 2018 1:48 pm
by drkosta
Hi Panos,

thanks for the fast response.

Unfortunately this handler do not work neither.

I played around with exitField and closeField and figured out that "closeField" message works "exitField" do not. And I'm not sure if closeField works like it was thought to work.

According to LC Dictionary "exitField" message is send when a field loses the focus but the content was not changed by user.

And "closedField" message should have been sent when user has changed the content. But entering the field end exiting without changes seems to send "closeField" message to the engine.

Regards

Kosta

Re: openField handler has no effect when entering an android native field widget (LC9.0.0 RC1)

Posted: Sun Mar 18, 2018 9:05 pm
by drkosta
LiveCode_Panos wrote:
Thu Mar 15, 2018 11:34 am
Hi drkosta,

This looks like a bug to me.

Does the following serve as a workaround in your use case? (put it in the card script)

Code: Select all

on keyboardactivated
   set the text of widget "myAndroidField" to empty
end keyboardactivated
Best,
Panos
--
Shall I file a bug in quality.livecode.com?

Re: openField handler has no effect when entering an android native field widget (LC9.0.0 RC1)

Posted: Mon Mar 19, 2018 3:16 pm
by LiveCode_Panos
Hi drkosta,

Yes please, that would be great.

I tested again and if I add the "keyboardactivated" handler in my card script, it fires every time I click on the native field and the keyboard appears. Not sure why you see different behavior.

RE the openfield message, it is a bug that it is not sent in your use case.

Kind regards,
Panos
--

Re: openField handler has no effect when entering an android native field widget (LC9.0.0 RC1)

Posted: Mon Mar 19, 2018 3:43 pm
by drkosta
Hi Panos,

the keyboardaktivatet handler works in cardscript not in widget script.

But in cardscript I cannot determinate which field was used. There are lot of fields in my card an I want only the one on which was clicked to be deleted. But „mouseup“ messages neither send or received from widget.
Really confusing.

Regards

Kosta