06-11-2009 03:50 PM
I have a class which derives from BitmapField.
The intention of this class is to download an image from the net and update the display once the image is loaded.
Code is pasted here:
The callback happens in
public void wdcCallback(final String data)
However the image on screen does not update after calling invalidte() until i focus on the container of the BitmapFIeld or scroll the list which contains it.
I have tried a few different approaches to get the field to update as can be seen from the commented out lines.
But nothing seems to work.
Anyone have any suggestions?
Solved! Go to Solution.
06-12-2009 12:50 AM
What a pain in the **bleep**, i have to pass a reference from the ListField all the way down to the WebBitmapField
The Heirarchy is thus:
06-12-2009 04:45 AM
I can see why you would have to do this. The HorizontalFieldManager is not actually owned by any Manager so is not present on the Screen. You are just using it to format the ListField row. So the only component in your chain which is a real Field and has some real screen acreage is the ListField.
A grubby way to do this would be to use getActiveScreen().invalidate().
06-12-2009 12:35 PM
I don't think you can invalidate a Bitmap, I presume you mean invalidating the BitmapField.
My explanation is based around how I think you are drawing your Fields in the ListField. I might be wrong.
The key question is "Is the BitmapField actually included in a Manager that is included in the Fields added to the Screen?".
It is included in a HorizontalFieldManager, but that Manager is, I'm guessing, managed as part of the drawListRow processing, so is never in itself, added on the Screen, it is just drawn on the screen. So invalidate() will look to see which part of the Screen needs to redrawn, by determining the actual screen extent associated with the Field, and discover the Field is not actually added to any Screen.
Every Field has the possibility of a Manager. if you do a 'getManager()' recursively on a Field, you should eventually get to the top Level Field, that will be a Screen. If you do this to your ListField, you will get to the Screen. However if you do this to your BitmapField, the chain will stop at the HorizontalFieldManager. You never 'add' your HorizontalFieldManager to the ListField (and you can't anyway!).
Hope this makes sense.