Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
hims_3009
Posts: 227
Registered: ‎12-16-2009
My Device: 9530,8900,9000
My Carrier: Airtel,Docomo
Accepted Solution

Wants to get field with focus

Hi,

I added 5 List Field in verticalFieldManager and added verticalField in Screen.

Now problem is that when i click on menu i wnats to know that on which list field the focus is?

 

i used the function on Menu click event

Field field=MainScreen.this.getFieldWithFocus();  but it always returns the VerticalFieldManager

so how can i get the index of the listField....?

 

Thanks,

Himanshu Lathiya

 

Lathiya Himanshu
Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Wants to get field with focus

ask the manager for the field with focus

while (field is a manager) field=manager.getfieldwithfocus

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
prash_bb_dev
Posts: 68
Registered: ‎03-17-2010
My Device: 9000,9500,8900
My Carrier: Airtel,Vodafone

Re: Wants to get field with focus

Try getLeafFieldwithFocus() method. It will always return non manager field. More over you can compare it using instanceof operator.

 

Please use plain text.