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

Web and WebWorks Development

New Developer
Posts: 4
Registered: ‎12-31-2009
My Device: Not Specified




I want to know the exact difference between net.rim.device.api.browser.field and net.rim.device.api.browser.field2 ?

I started using browser.field2 as i  need ajax support.


My understanding is, The classes in browser.field package are used to render the screens in the browser and handle all the request and response events manually by our own code.


But the browser.field2.BrowserField class is used directly to embed a browser and just giving the url of the website will render the screen and it itself will manage the navigation options.


But my problem is, when i use browser.field2.BrowserField class, i am not able to navigate after the login screen? When i press on login button, the same login page is loaded again and again. I am not able to figure out the problem.


Can anyone have a clue on this issue?

Is there any sample application using browser.field2 package?




Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: net.rim.device.api.browser.field2

Hi furzana,


Thanks for your post, that is a really great question.  One of the items on my quarterly content plan is to cover this subject in as greater detail as I understand there is a lot of confusion out there about this.


To help explain this, let me start by clarifying that there are two separate browser rendering engines included in the BlackBerry handheld software:

1. The first has been around for a long time (since ~ 3.8 last changes being made in v4.5); The level of content support provided by this browser is limited: DOM L1 (read only access to the DOM), partial support for HTML, JavaScript and CSS


2. A second engine was introduced with the BlackBerry Bold (version 4.6 handheld software) codenamed "Mango".  This engine greatly improved the capabilities of the BlackBerry browser by providing full support for industry standards like HTML 4.01, JavaScript 1.5, CSS 2.1 and adding support for DOM L2 (read/write) and XmlHttpRequest (AJAX).


browser.field (BF1)

  • Configured to use the 'old' browser rending engine
  • Implementation demonstrated in the BrowserFieldDemo application of the BlackBerry JDE
  • BF1 provides basic page rendering capabilities "out of the box", things like cookie management, redirects, history support, etc need to be implemented by the developer.
  • Content rendered using a BF1 should look similar to content rendered by the BlackBerry browser on a 4.5 device.  Even if the BF1 is written a newer JDE (4.7 or even 5.0), an application that uses BF1 is still hardwired to use the 'old' rendering engine.  There is no way to change this.

browser.field2.BrowserField (BF2)

  • Configured to use the 'new' browser rendering engine (Mango)
  • We are still working on publishing a demo.  I replied to a post recently with some BrowserField2 sample code.  This may be helpful to you as a learning resource in the meantime.
  • BF2 provides a lot of built in functionality that developers do not need to worry about implementing on their own: history, backgeround color, CSS Hover, programmatic DOM access, cookies, event listener, access local (e.g. file system) or remote content, etc.


BlackBerry Widgets applications, introduced in 5.0, use an embedded browser.field2.BrowserField object for rendering content.


For the login problems you are describing, what is the URL you are accessing?  Can you capture any HTTP request/response information that is being transmitted between your application and the server?  In my experience, whenever a login page reloads after a signin attempt (without displaying an error message), it usually suggests the secure site redirected flow back to the login page for some reason (usually represents an expired session state).  Could this be a possibility in this situation?  I believe further investigation is necessary.


Best regards,

Adam Stanley


Follow me on Twitter: @n_adam_stanley
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Posts: 1
Registered: ‎08-17-2009
My Device: Not Specified

Re: net.rim.device.api.browser.field2

Hi Adam,


According to API documentation net.rim.device.api.browser.field2 is available since 5.0.0 and

net_rim_api.jar included in the simulator doesn't have this class.

Seems that 4.7.0 doesn't have also.


Can you confirm that third party applications can use this field since 4.6.0 ?



  Alexey Shevchuk

Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: net.rim.device.api.browser.field2

BrowserField2 is only available on OS version 5.0 and higher.  No other previous version has this control.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Contributor
Posts: 2
Registered: ‎10-17-2011
My Device: Bold 9700
My Carrier: Vodafone

Re: net.rim.device.api.browser.field2

Hi there,


I also encountered the same problem re: can't pass the login screen.

After inspecting the request / response. It seems that the cookie was not working on a real device. It worked fine from the simulator.


I also tried set the cookie enabled explicitly, although cookie should be enabled by default in field2.BrowserFieldConfig


Any help?