Page 1 of 1

mobilecontrols and object scripts

Posted: Sat Nov 24, 2012 4:52 am
by cusingerBUSCw5N
I have to use mobilecontrol fields on my android app because androids won't type into a field. Right now I have a close keyboard button that appears when the page opens - but I would prefer to have it pop up if text is entered into a field (the same time the keyboard pops up).

I am wondering if I can set a simple script -
on mousedown
set the vis of button "close_keyboard" to true
end mousedown

How do you do that with mobilecontrol?

I know about mobilecontrolcreate, mobilecontrolset, mobilecontrolget, mobilecontroldelete

There is a mobilecontroldo, but I'm not sure it is the right command or how to use it properly.

Thank you.

Re: mobilecontrols and object scripts

Posted: Sat Nov 24, 2012 1:40 pm
by Klaus
Hi,

this is from the "Android Release Notes":
...
The following messages will be sent to the current card of the default stack when the keyboard is shown or hidden:
keyboardActivated
keyboardDeactivated
Handle these messages to move controls or change the display layout to take account of the restricted screen area that will be available.
...
Maybe this is what you are looking for?


Best

Klaus

Re: mobilecontrols and object scripts

Posted: Thu Nov 29, 2012 4:31 pm
by cusingerBUSCw5N
not exactly - although this is not a big issue for me - it's more a curiosity.

I want to have
On mousedown
set the vis of button "keyboard_close" to true
end mousedown

...but there is nowhere to "put" these instructions - since is it is a mobilecontrol

Right now, I have the keyboard_close button visible if there is a mobilecontrol input field on the page...but it would be slicker to have it only popup if someone used that input field.

as I said, not a big deal - since my way is quite functional, just curious. "something" currently is telling it to open a keyboard when someone clicks on the input field - it would be nice to have it also open my keyboard close button.

Re: mobilecontrols and object scripts

Posted: Thu Nov 29, 2012 5:09 pm
by Klaus
Hmmmm, sounds like this should work for you:

Code: Select all

on keyboardActivated
  set the vis of button "keyboard_close" to true
end keyboardActivated
If you mean to "put a mousedown script into the native field control", not?

Re: mobilecontrols and object scripts

Posted: Fri Nov 30, 2012 5:54 am
by cusingerBUSCw5N
yes - but where do you put the code? can you put that on the card level? There's no "object" to attach the script...

Re: mobilecontrols and object scripts

Posted: Fri Nov 30, 2012 11:04 am
by Klaus
Yes, put it into the card script.

P.S.
Did you check this one already?
http://forums.runrev.com/phpBB2/viewtop ... 53&t=13453

Re: mobilecontrols and object scripts

Posted: Sun Dec 02, 2012 6:52 am
by cusingerBUSCw5N
Doesn't work - on android that is.

keyboardactivated seems to be for ios only (per the library). I was looking for something that triggers for an android mobilecontrol input field. Something triggers the android to open a keyboard...I was just curious if you could add other things like making a close button visible.

not critical - and nothing that keeps me up at night (unlike other issues have!)

good to know that there is a solution for ios.

Re: mobilecontrols and object scripts

Posted: Sun Dec 02, 2012 12:17 pm
by Klaus
keyboardactivated seems to be for ios only
Things ain't always what they seem to be!

This is from tha latest "Android Release Notes" (LC 5.5.3):
...
Activation notifications
The following messages will be sent to the current card of the default stack when the keyboard is shown or hidden:
keyboardActivated
keyboardDeactivated

Handle these messages to move controls or change the display layout to take account of the restricted screen area that will be available.
...