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

New Contributor
Posts: 5
Registered: ‎01-28-2013
My Device: Developer
My Carrier: Nil

BrowserField2 not rendering the web page having CSS and scripts completely



I have a requirement wherein I have to show a web page in the native BB application.

For this I am using the following API's:


import net.rim.device.api.browser.field2.BrowserField;
import net.rim.device.api.browser.field2.BrowserFieldConfig;
import net.rim.device.api.browser.field2.BrowserFieldRequest;
import net.rim.device.api.browser.field2.ProtocolController;


Now the HTML page which I am trying to show in this browserField is having a script and css applied to it.


I have tried following two options:


1) Used the browserField.requestContent method,where I have pass the URL of the page.

     In this case only small part of a page is seen.


2) Used the browserFiled.displayContent method,where I am passing the HTML content of the page.

    In this case the components present on the from such as username,password and sign-in button is visible.

    Also the images present are rendered using the handleResourceRequest() method.


The problem I face here is the styles to the page applied are not seen in the browserFiled view.

For example , the page is having light blue background , with all the fields centered in the page.


But this is not reflected in the browserField.It shows me all the fields on a white background and all of them left aligned.


I want to show this page exactly same as it appears on the normal web browser.


Please do let me know any suggestions for this partucular issue. 



Thanks in advance,