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
streak81
Posts: 204
Registered: ‎08-09-2010
My Device: 9930, PlayBook

BB7 BrowserField does not render in mainscreen "paint" method

Up until OS 7, I was able to manipulate the graphics object in the "paint" method of a screen where a browserfield was present.  If i have a browserfield on the screen in os 7, it appears to draw the browserfield on top of whatever drawing was done in the paint method.  My app fakes some screen transitions while it is scrolling the browserfield so in os 7 this is broken.  is this something that will be fixed?  does anyone have a workaround?

Developer
sonicboomboy
Posts: 466
Registered: ‎03-04-2009
My Device: 8520

Re: BB7 BrowserField does not render in mainscreen "paint" method

sticking to this thread.
I have the similar issue.
i have a browserfield and listfield. Only one Field can be displayed at the same time. So in manager i'm doing add/remove for each field above . That causes IllegalStateException being thrown internally in BrowserField. ( i see this in EventLogger).
Got resolved! Press kudo icon!
Developer
streak81
Posts: 204
Registered: ‎08-09-2010
My Device: 9930, PlayBook

Re: BB7 BrowserField does not render in mainscreen "paint" method

Just to freshen up this topic, I am including a screenshot of the behavior i described in the first post as well as a sample project.  On the left is an OS 6 9800 simulator showing the attached sample app.  The browserfield is rendered, then a semi-transparent rectangle is drawn on the screen covering part of the browserfield.  On the right is the OS 7 9900 simulator with the same app running.  as you can see, the red rectangle appears to be behind the browserfield.  Here is the paint() method of this screen:

 

...
protected void paint(Graphics graphics)
{
//when the browserfield renders, it should be painted in this method
super.paint(graphics);

//after the screen is painted, let's draw a see-thru red rectangle on the right hand side of the screen
graphics.setColor(Color.RED);
graphics.setGlobalAlpha((int) (0xFF*.5));
graphics.fillRect(Display.getWidth()/2, 0, Display.getWidth()/2, Display.getHeight());

//This works in all oses < 7...why in OS 7 does the browserfield render AFTER the paint method is fired?
}

...

 

 

 

 

This is definately a bug that I need to resolve or work around for os 7 devices.  Any suggestions are welcome!

 

 

BrowserFieldPaintIssue.png

 

Developer
streak81
Posts: 204
Registered: ‎08-09-2010
My Device: 9930, PlayBook

Re: BB7 BrowserField does not render in mainscreen "paint" method

I have created a bug in JIRA for this:

https://www.blackberry.com/jira/browse/JAVAAPI-2141

 

 

New Developer
ajibz
Posts: 13
Registered: ‎04-01-2012
My Device: 9630

Re: BB7 BrowserField does not render in mainscreen "paint" method

have you been able to resolve this? If so how? Thanks.