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
Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

HorizontalField index

I have a Horizontal Manager where i am adding a vertical manager in for loop.So i have 5  vfm added to a single hfm.I want that when i click on the 1st vfm getFieldWithFocusIndex() this method should return 1 and subsequently fr 2nd vfm 2 and so on.But for nw its returning arbitary numbers like 1 5 8 11 14.Can anyone hlep me out

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: HorizontalField index

if you ask the vfm for the field with focus you get one of its childs.
try checking on the hfm instead, if that does not work i would suggest getLeafFieldWithFocus and getManager followed by getIndex.
----------------------------------------------------------
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
Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: HorizontalField index

Firstly i want to mention that both my hfm and vfm are focusable.Secondly i followed what you suggested.I asked hfm for field with focus instead of vfm and its again returning arbitrary numbers like 1 7 12.I also tried "getLeafFieldWithFocus and getManager followed by getIndex." on hfm,it returns 0 everytime.And if i do it on vfm,it returns arbritrary numbers like 1 7 12

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: HorizontalField index

i would suggest that you check the object tree with a debugger to see if you are targeting the correct field.
----------------------------------------------------------
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
Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: HorizontalField index

yes its coming in the right field