change focus to another element (i.e. textbox) at click button

1,767 views
Skip to first unread message
Assigned to shadow...@gmail.com by taifu...@gmail.com

matthia...@gmail.com

unread,
Jan 25, 2014, 11:07:15 PM1/25/14
to mitappinv...@googlegroups.com
hi, i need help about the focus changing at my little app.

there are some horizontalarangement. all hidden. inside are 3 elements(a label, a textbox and a checkbox) after every press the button the next hr will be set to visible. how can i code that the focus is change to the next textbox that will be visible and perhaps the keybordlayout will be show.

Enis

unread,
Jan 28, 2014, 3:17:26 PM1/28/14
to
Hello...

You cannot make the keyboard visible, but you can hide the keyboard with the "Call textboxX.Hide block.

You also cannot set focus.  You can monitor when a textbox GotFocus and LostFocus with the appropriate blocks from the textbox palette.  Focus come in order of placement in the arrangement.  If it's label, then textbox, then checkbox, the textbox will get focus first.

To cycle through the horizontal arrangements making one visible at any given time, here's a code block:

Is this what you were asking?

matthia...@gmail.com

unread,
Jan 29, 2014, 2:18:38 AM1/29/14
to mitappinv...@googlegroups.com
> Is this what you were asking?

partially yes.

my problem is to set the cursor into the textbox, that will be visible after klick a button.

in the moment i write a number into a textbox. this box have the cusror and the focus. now i klick the button, an a new textbox appears. but the cursor and focus stays at previous box. this is an ugly usability. the cursor should blinking in the new textbox.

Enis

unread,
Jan 29, 2014, 3:21:28 AM1/29/14
to mitappinv...@googlegroups.com, matthia...@gmail.com
I'm trying to find out if this is possible... right now, I don't think it is, but let me do some checking...

Enis

unread,
Jan 30, 2014, 2:46:14 AM1/30/14
to
Hi, OK, here's some info I got when I asked if there were a way to set focus:

I don't think there currently is; focus on mobile is a bit more 'delicate'."

It's a bit different than Desktop behavior, because focus generally means displaying the keyboard in apps, so either you might want focus, you might not want the keyboard, but then, why would you want focus...


I know this isn't what you want to hear, but it's the reality of the situation...


matthia...@gmail.com

unread,
Jan 31, 2014, 1:21:47 PM1/31/14
to mitappinv...@googlegroups.com
> It's a bit different than Desktop behavior, because focus generally means displaying the keyboard in apps, so either you might want focus, you might not want the keyboard, but then, why would you want focus...

i only want the possibility to set an element is directly editable without an separat klick. in my app i set textbox to be visible after i click an button. it would be very nice the cursor could set into a texbox to direktly edit numbers into it.
actually the cursor is still blinking at the former textbox. the occurence of the keyboard is would be helpful for it.


Enis

unread,
Jan 31, 2014, 6:43:03 PM1/31/14
to
I FIGURED OUT A WORK-AROUND!!!  YEA!

It turns out that if you have multiple textboxes for example, but one is WAY off the screen, you can make it invisible and then visible again and the focus will more to the next control that's visible.

I have attached an AIA file to this response... the blocks are below... simple and clean. Try it out and you'll see that even though the text boxes don't disappear (I've just go them on the screen for ease right now), that you can flop focus from one text box to the other with the two buttons!!!  You'll have to figure out for yourself how to hide that 2nd textbox or put it somplace where it won't be seen, and then use it as the trigger for the one that IS visible on the screen.  Please let us know if that worked out for you or not...

Here's the block:


Focus.aia

Jim Ray

unread,
Jul 4, 2014, 12:26:33 PM7/4/14
to mitappinv...@googlegroups.com
Sweet! Thanks every one!

Jim
Reply all
Reply to author
Forward
0 new messages