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: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Determining selection of the field

How to determine that s perticular field such as BitmapField is selected or not?  Is there a method such as isSelected()?

Developer
Posts: 243
Registered: ‎07-22-2011
My Device: BlackBerry Z10
My Carrier: AirTel

Re: Determining selection of the field

Hi,

 

If u want to click bitmapfield or if the current focus is in which field.

 

In first case you can override navigation click of any field like bitmapfield or labelfield..

 

In second you can find usinf Field f = getLeafFieldWithFocus(); and if(f instanceOf BitmapField) like that.

 

Regards,

Lakshman K

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

Trusted Contributor
Posts: 184
Registered: ‎11-26-2010
My Device: Not Specified

Re: Determining selection of the field

I agree with Lakshman's reply. You can use getLeafFieldWithFocus() or getLeafFIeldwithFocusIndex() on the manager which is holding this your field.

 

A Y.

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

Re: Determining selection of the field

when you mark some text it is called selection, there is a isSelecting method that checks for this.
it seems you talk about focus, you can call http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/Field.html#isFocus()
depending on the situation getLeafFieldWithFocus is also helpful, as lakshman9687 suggested.
----------------------------------------------------------
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