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: 52
Registered: ‎11-03-2008
My Device: Not Specified
Accepted Solution

Click event for a BitmapField

Hi,

 

Can anyone guide me to how to capture the click event for a BitmapField ? I want to execute some piece of code after the bitmap gets focus and the user presses the trackwheel button.

 

 

 

Thanks

Arun

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

Re: Click event for a BitmapField

extend bitmapfield and overwrite navigationclick etc
----------------------------------------------------------
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
Highlighted
Developer
Posts: 25
Registered: ‎09-08-2008
My Device: Not Specified

Re: Click event for a BitmapField

BitmapField bmf_temp = new BitmapField(bitmap_type, BitmapField.FOCUSABLE)
                {
                    private XYRect xyrect=new XYRect();
                    protected boolean navigationClick(int status, int time) 
                    {
                      // This is method will invoke when you click on your bitmapfield and you can write your piece of code here
 
                      return true;
                     }
};

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Click event for a BitmapField

[ Edited ]

I think you might also have to tell the BitmapField to consume the click, which means, in the sample given, changing:

new BitmapField(bitmap_type, BitmapField.FOCUSABLE)
to

new BitmapField(bitmap_type, BitmapField.FOCUSABLE | BitmapField.CONSUME_CLICK)

 

Edit - Opps - up-to-late last night.  Ignore this, see below.....

Message Edited by peter_strange on 11-06-2008 02:01 PM
Developer
Posts: 17,011
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Click event for a BitmapField

Bitmapfield does not have a style CONSUME_CLICK, that would be ButtonField.
----------------------------------------------------------
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: 52
Registered: ‎11-03-2008
My Device: Not Specified

Re: Click event for a BitmapField

Thanks gsk_56. I am now able to do what I wished. Thank you all :-)
New Developer
Posts: 124
Registered: ‎04-29-2009
My Device: Not Specified

Re: Click event for a BitmapField

hai,

what method should be used instead of navigation click for touch screen storm.I tried with navigation click but was not workingSmiley Sad

kamala 

Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Click event for a BitmapField

Hi Kamala,

 

Use invokeAction().

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
New Developer
Posts: 124
Registered: ‎04-29-2009
My Device: Not Specified

Re: Click event for a BitmapField

hai rajat,

I used it along with onfocus and onunfocus method,i found that invoke action was not reachable.I mean to say in case of shortcut bar,touch down must invoke tooltip and touch up must remove the tooltip and also push a screensuch that once pushed the tooltip must be removed.

 

 

I tried with touch events,but I found the bitmap was not focussable.

kamala 

New Developer
Posts: 124
Registered: ‎04-29-2009
My Device: Not Specified

Re: Click event for a BitmapField

hai,

in my application i used list fields and the shortcut bar as the status.when i create an application with shortcut bar alone the invoke action works but when i use list and shortcut bar,i find the screen for the list item getting displayed for every bitmap click.hope u understand.

help me out.whts wrong

 

kamala