views:

491

answers:

2

working on BB 9000

hey in my screen there is a label field ,below it there is a bitmap field and below that there is a list field

when i scroll down all repainting is fine but when i scroll up from list field to Bitmap field

then my image does not gets repainted till i reach at the top most label field.

i am unable to figure out why it happens

the label field is set to focussable for some reasons...

making bitmap field as focussable does not also solves the problem

code :

LabelField lbl = new LabelField("Hello",Field.focussable)

detail_img = Bitmap.getBitmapResource("container.png");
detail_img_field = new BitmapField(detail_img);

 reviewlist =  new Review_List(my_vector); //Review_List is  a class that fills value in list field

 reviewlistManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL |Manager.VERTICAL_SCROLLBAR)
 {              

                 protected void paint(net.rim.device.api.ui.Graphics graphics)
                    {
                         super.paint( graphics );
                    }

                      protected boolean keyDown( int keycode, int status )
                        {
                           my_Screen.this.invalidate();
                            return super.keyDown( keycode, status );
                        }
                        protected boolean keyUp(int keycode, int time)
                        {
                            my_Screen.this.invalidate();
                            return super.keyUp(keycode, time);
                        }

                        protected boolean navigationMovement( int dx, int dy, int status, int time )
                        {
                            my_Screen.this.invalidate();
                            return super.navigationMovement( dx, dy, status, time );
                        }

                        protected int moveFocus(int amount, int status, int time)
                        {
                            my_Screen.this.invalidate();
                           return super.moveFocus(amount, status, time);
                        }
                        protected void onFocus(int direction)
                        {
                            my_Screen.this.invalidate();
                            super.onFocus(direction);
                        }
                        protected void onUnfocus() 
                        {
                            my_Screen.this.invalidate();
                            super.onUnfocus();
                        }

                };

reviewlistManager.add(reviewlist);
backgroundMannager.add(reviewlistManager);
add(backgroundMannager);
A: 

Is this on a simulator or real device? Sometimes simulators have rendering issues (such as not redrawing a region they should have) while the real device does not.

Marc Novakowski
well this problem exists in both the simulator and the device
SWATI
Have you tried other simulators or devices? Do you have a code sample you can post?
Marc Novakowski
well i tried on simulators n devices like - curve 8300,8900,bold 900,storm 9350 but same prob occurs...code is to big to be posted....anyother option,else i have to shorten it somehow...let me try...
SWATI
putting a snippet in this post is ideal, but for longer chunks of code you can use http://pastebin.com/
Marc Novakowski
well marc i added snippet in my ques...i tried to shorten it...hope this may help!!!!its really urgent plzzzz help!!!!!!!!!!
SWATI
+1  A: 

yuppieeeeee

i got the answer

i just placed the bitmap field inside a VerticalFieldManager,enabled with vertical scroll n my problem got solved...

code :

    rest_manager = new VerticalFieldManager(Manager.VERTICAL_SCROLL)
          {
            protected void paint(net.rim.device.api.ui.Graphics graphics)
             {
                  int y = this.getVerticalScroll();                                     
                                     graphics.drawBitmap( 0, y, rank_img.getWidth()+10, 
rank_img.getHeight(), rank_img, 0, 0 );

                                     super.paint( graphics );
                                }
                     }
SWATI