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
New Contributor
Posts: 2
Registered: ‎05-26-2010
My Device: 9550
My Carrier: Airtel
Accepted Solution

How to repaint Grid2 Background if there is an event in Grid1? URGENT

Hi

 

Device simulator: BB Storm 9550

 

I have Grid1 (G1) with 4 custom btns, Grid2 (G2) with 3 custom btns in 2 different classes. (requirement)

 

Grid1 (placed above) -> btn1, btn2, btn3, btn4

Grid2 (placed below) -> btn1, btn2, btn3

 

Whenever I press any one of the custom btns in Grid1. I need to repaint the background of Grid2 with any one of its 4 corresponding PNG img files.

 

How to repaint Background of G2 if I press a btn in G1.

 

I have a listener of those custom btns implementing

 

OnFocus()with Invalidate

OnUnFocus()with Invalidate

paint()

 

Best Regards

ABS

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: How to repaint Grid2 Background if there is an event in Grid1? URGENT

You can call invalidate on Grid1 when one of your buttons is clicked on.  This will cause Grid1 to trigger its paint method.  The paint method should not be called directly.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Highlighted
New Contributor
Posts: 2
Registered: ‎05-26-2010
My Device: 9550
My Carrier: Airtel

Re: How to repaint Grid2 Background if there is an event in Grid1? URGENT

Late reply:

 

They where in 2 different classes. I have made it one and this is achieved. Thanks.