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

Web and WebWorks Development

Reply
New Developer
tan_addictive
Posts: 11
Registered: ‎10-24-2008
My Device: Not Specified

Embedded browser using BrowserContent and RenderingApplication [Urgent]

Hi everyone,

 

We are trying to implement an embedded browser within our UiApplication and

will really appreciate anyone who can help us on an urgent basis.

 

We are implementing the our UiApplication similar to

the BrowserFieldSampleApplication as below:

 

BrowserFieldSampleApplication extends UiApplication implements RenderingApplication

{

//with private members among others the following:

BrowserContent  browserContent;

BrowserContentManager browserContentMgr;

MainScreen _mainScreen;

}

 

 

In this setting the application always shows a default menu popup,

with options like "Page view", "Column view", "Get Link", "Close" etc.

 

Everytime we click some link on the page, this popup comes up first and we have to choose

"Get-Link" to browse any link.

 

 

We want to make this popup disappear and make our browser act like the native browser.

 

 

We have tried everything, even called

 

_mainScreen.removeAllMenuItems();     but nothing helps and the popup stays like that.

 

 

When we switch to mouse mode, even when the mouse is clicked on a link,

instead of navigating to the page, the popup comes first and we have to slect the Get-Link from the keyboard.

 

 

Is the apis provided to developers different from the native browser's api?

 

Is there anyway to make the popup disappear?

 

Please use plain text.
Administrator
MSohm
Posts: 14,528
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Embedded browser using BrowserContent and RenderingApplication [Urgent]

This behaviour is expected and by design.  The browser field APIs currently use a different rendering engine than the BlackBerry browser, so you will see different results between the two.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Administrator
MSohm
Posts: 14,528
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Embedded browser using BrowserContent and RenderingApplication [Urgent]

In BlackBerry device software version 5.0 you can use the BrowserField2 APIs, which use the new browser rendering engine.  This can allow you to mirror the browser included on the BlackBerry smartphone.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
cwhite124
Posts: 9
Registered: ‎01-09-2010
My Device: BlackBerry Curve 8530

Re: Embedded browser using BrowserContent and RenderingApplication [Urgent]

Unfortunately this gets a bit tricky.  Here goes a quick explanation of what you can do:

 

1. Using browser.field in 4.X and 5.X

- You have to search through the main menu associated with the screen for a menu item that contains the word "Link".

- You will need to do this in navigationClick AND touchEvent for touch devices (4.7 and above).

 

Menu menu = getScreen().getMenu(0);

String label = null;

int size = menu.getSize();

for(int i=0; i<size; i++) 

{

    label = menu.getItem(i).toString();

 

    //OS 4.2+ = Get Link, OS 5.0 = Open Link

    if(-1 != label.indexOf("Link")) {

item.run();

  return true;

    }

}

 

2. Using browser.field2 in 5.X

- As explained by Mark, the new field2.BrowserField class in BB 5.0 will handle the click as you would expect.

- However, I have seen a problem with the new field2.BrowserField class on non-touch devices.  Essentially, once you click on the field2.BrowserField object it doesn't relinquish the focus and so you can't use the trackwheel to navigate and select a different type of field on the screen.

Please use plain text.