[RESOLVED] - Move to fielComp via script

Is it possibible to select a fieldComp via a button, script or keyboard, so that the User can Type something in without having to use the mouse?
I tried using the panel class with something like: op(‘field1’).panel.inside=1 and op(‘field1’).select.inside=1
but this only changes the value of the panel, bit doesnt really go to the field and selects it.

Its a little bit weird, but it is:
op(‘field1’).panel.focus = 1

Non-weird way:
op(‘field1’).setKeyboardFocus()

:wink:

Thanks alphamoonbase and Ivan,
op(‘field1’).panel.focus = 1 sets the cursor in the right place, but still I cant immediately start writing in the field. I tried to add op(‘field1’).panel.select=1, but still nothing. If I press

“op(‘field1’).setKeyboardFocus()” somehow doesnt work.
I added both in the attached test-field_focus.toe (4.3 KB) tox.

don’t assign it to 1. Just call op(‘field1’).setKeyboardFocus() or op(‘field1’).setKeyboardFocus(selectAll=True)

1 Like

That works well. And the the (selectAll=True)-option is exactle what I need. thanks, Ivan. Do you know of it is possible to set the field to uppercase, so that the user automatically writes every letter in capital?

field1.tox (1.1 KB)

This component has a panelexec inside it that converts the field to upper case AFTER typing. I don’t think it’s possible during.

works perfect! Thank you.

Great! Please mark subject RESOLVED

I am really sorry to ask even thsi question. But where do I find the button for marking the post resolved?

There should be a little pencil icon near the title of the post. Just change the title to "RESOLVED - " + the original title.