Page 1 of 1

cursor begin in field

PostPosted: Mon Jun 02, 2003 9:34 am
by Harjo
How can I let the cursor begin in an specific field when I switch to another form?

(Like: Goto Field in FMPRO)

PostPosted: Mon Jun 02, 2003 9:56 am
by edward
elements.fieldname.requestFocus
This requests the focus for a field and the cursor will enter that field.

HTH

PostPosted: Mon Jun 02, 2003 10:13 am
by Harjo
On my global field: globals.gebruikersnaam
it does not work.
elements.globals.gebruikersnaam.requestFocus


I'll get the following error:
The undefined value has no properties.

PostPosted: Mon Jun 02, 2003 11:02 am
by Guest
Make sure that element has the name property filled in, once it has it will show up in the methods tree and you can use it.

PostPosted: Mon Jun 02, 2003 11:11 am
by maarten
Did you specify to which form your going?


In next example I'm going to the form orderDetails, requesting focus on the global glAction

forms.orderDetails.elements.glAction.requestFocus()

PostPosted: Mon Jun 02, 2003 11:26 am
by Harjo
Yes, the property-name did the trick!

PostPosted: Fri Jun 06, 2003 1:20 pm
by Harjo
I have a method:
forms.gebruikersLogin.elements.gebruikersnaam.requestFocus();


which works fine when I call it thru the Methods-Menu.
It won't start when I assign it to the onLoad-function on the same form!
What am I doing wrong?

BTW Servoy 1.1 (WinXP)

PostPosted: Thu Jul 17, 2003 11:14 am
by jcompagner
Are you sure that it doesn't start that method?
Or is it that that method just doesn't work when using onLoad (should be onShow i think)

In the build after RC4 request focus is much better handled.