09-23-2009 01:43 PM
I wrote a custom field class that displays the field returned by BrowserContent.getDisplayableContent().
This works fine except that I cannot find a way to make this field's background transparent so that the owning Manager's background image would be visible.
I added style="background-color:transparent;" to the html's <body> but it still draws a white background.
How can I do this?
Thanks in advance...
11-10-2009 04:51 PM
I decided to install JDE 4.6 because the net.rim.device.api.ui.decor.Background class might help me.
I tried this:
bgTransparent = BackgroundFactory.createSolidTransparentBackground
contentField = browserContent.getDisplayableContent();
contentField.setBackground(bgTransparent);
but the browser field still has a non-transparent white background.
Am doing something wrong here? Or is this just impossible to achieve?
11-10-2009 05:36 PM
This would be impossible to do. How do you determine transparency? With a white background? What about if the web page has a background image? What if the website has a different background colour?
Why do you want to do this anyway?
11-10-2009 06:28 PM
Thanks for your reply...
I need to do it this way for all the Field objects I use because, the manager (and/or screen) in which they are contained usually have a gradient or a very light background image (like a watermark) that have to show through.
So for the parts where I use a browser field, we don't want to have opaque rectangular areas blocking the background.
This is not a problem for other Fields because I can control the paint() and paintBackground() methods of those classes. But the browser field is an black box where I cannot override methods at run time.
11-10-2009 06:42 PM
Why do you want to make the browser field harder to read that way? Like I said, it's not going to be possible.
One way you could interfere with the browser field would be to try and intercept the underlying connection and mangle the HTML, but that is rather tricky to do.
06-11-2010 02:01 AM
What about if the web page has a background image?
What if the website has a different background colour?
Why do you want to do this anyway?
Why do you want to make the browser field harder to read that way?
-----------------------------------------
Why the obstinacy? This is a perfectly reasonable objective. e.g.:
With my application, I am displaying text and images that are defined by downloaded htmls. This way, the text and images of my application are configurable and dynamic at runtime. The htmls won't have a background image or background color because I defined them, and ideally, I would like the background of the field manager that I put the browsercontent.getDisplayableField() into, to show through.
reycri - did you find way to do this? Or, anyone else have any other constructive ideas? I will post back my solution if I find one.
Cheers.
02-01-2011 11:59 PM
Any resolution to this?
I need this feature. By the way, it is a very basic feature and I don't understand why someone would argue against it unless they have no idea about basic UI design concepts.