cursor begin in field

Questions, tips and tricks and techniques for scripting in Servoy

cursor begin in field

Postby Harjo » Mon Jun 02, 2003 9:34 am

How can I let the cursor begin in an specific field when I switch to another form?

(Like: Goto Field in FMPRO)
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby edward » Mon Jun 02, 2003 9:56 am

elements.fieldname.requestFocus
This requests the focus for a field and the cursor will enter that field.

HTH
Edward Callaghan
Servoy
edward
 
Posts: 142
Joined: Wed Apr 23, 2003 9:35 pm
Location: London, UK

Postby Harjo » Mon Jun 02, 2003 10:13 am

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.
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Guest » Mon Jun 02, 2003 11:02 am

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.
Guest
 

Postby maarten » Mon Jun 02, 2003 11:11 am

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()
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Postby Harjo » Mon Jun 02, 2003 11:26 am

Yes, the property-name did the trick!
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Harjo » Fri Jun 06, 2003 1:20 pm

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)
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby jcompagner » Thu Jul 17, 2003 11:14 am

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.
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Methods

Who is online

Users browsing this forum: No registered users and 18 guests