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
Posts: 90
Registered: ‎09-07-2010
My Device: Not Specified

BrowserField 2: Navigation Mode

[ Edited ]

Hello,

 

I have a custom Manager which acts always as the titleBar on my screen, and below i have a BrowserField. I'm trying to achieve the correct behavior among them, so i want the browser to leave the foccus whenever i reach the top of the screen and vice versa.

 

The thing is i can't make it with NAVIGATION_MODE_POINTER because the broserfield never leaves the focus. The other possiblity, NAVIGATION_MODE_CARET, is good to achieve the focus behavior, but it's not much comfortable because it's character to character navigation. The final option, NAVIGATION_MODE_NONE, seems to be the correct one, but i found no information about how to use it. Just putting it leaves the browser with no focus, always. I'm also wondering if there's the possibility to use NAVIGATION_MODE_CARET so that the pointer only moves among links.

 

But i'm afraid i've seen so far some posts about that without any resolution...

 

Any suggestion? Has anyone solved such a thing like that?

 

Thanks in advance!

New Contributor
Posts: 4
Registered: ‎03-14-2011
My Device: BB 10

Re: BrowserField 2: Navigation Mode

[ Edited ]

I have the same problem on OS 6.0. Did you find a solution for this?

 

I see the native blackberry browser transfers focus from browser to the url bar. But in the app similar transfer does not work.


jromanoski wrote:

Hello,

 

I have a custom Manager which acts always as the titleBar on my screen, and below i have a BrowserField. I'm trying to achieve the correct behavior among them, so i want the browser to leave the foccus whenever i reach the top of the screen and vice versa.

 

The thing is i can't make it with NAVIGATION_MODE_POINTER because the broserfield never leaves the focus. The other possiblity, NAVIGATION_MODE_CARET, is good to achieve the focus behavior, but it's not much comfortable because it's character to character navigation. The final option, NAVIGATION_MODE_NONE, seems to be the correct one, but i found no information about how to use it. Just putting it leaves the browser with no focus, always. I'm also wondering if there's the possibility to use NAVIGATION_MODE_CARET so that the pointer only moves among links.

 

But i'm afraid i've seen so far some posts about that without any resolution...

 

Any suggestion? Has anyone solved such a thing like that?

 

Thanks in advance!



jromanoski wrote:

Hello,

 

I have a custom Manager which acts always as the titleBar on my screen, and below i have a BrowserField. I'm trying to achieve the correct behavior among them, so i want the browser to leave the foccus whenever i reach the top of the screen and vice versa.

 

The thing is i can't make it with NAVIGATION_MODE_POINTER because the broserfield never leaves the focus. The other possiblity, NAVIGATION_MODE_CARET, is good to achieve the focus behavior, but it's not much comfortable because it's character to character navigation. The final option, NAVIGATION_MODE_NONE, seems to be the correct one, but i found no information about how to use it. Just putting it leaves the browser with no focus, always. I'm also wondering if there's the possibility to use NAVIGATION_MODE_CARET so that the pointer only moves among links.

 

But i'm afraid i've seen so far some posts about that without any resolution...

 

Any suggestion? Has anyone solved such a thing like that?

 

Thanks in advance!


 

Developer
Posts: 53
Registered: ‎10-29-2010
My Device: Not Specified

Re: BrowserField 2: Navigation Mode

I had that proble in OS 5, so I endend using Navitagion_mode_caret.

 

In OS 6 it will work fine with Navigation_mode_pointer almost all the time (don't put the browserfield on a popupScreen or it won't work).

New Contributor
Posts: 4
Registered: ‎03-14-2011
My Device: BB 10

Re: BrowserField 2: Navigation Mode

I found out a hack..

with the navigation set to pointer mode, a click outside the browserfield manager invokes Manager.invokeAction(int). I used the getFieldWithFocus to verify which field has focus and then switch the focus to something else.

Developer
Posts: 53
Registered: ‎10-29-2010
My Device: Not Specified

Re: BrowserField 2: Navigation Mode

Good to know. Thanks Farahh!

New Developer
Posts: 39
Registered: ‎02-24-2011
My Device: Not Specified

Re: BrowserField 2: Navigation Mode

Thanks farahh!!

 

it was a great help! :smileyhappy:

Contributor
Posts: 16
Registered: ‎04-29-2010
My Device: 9500

Re: BrowserField 2: Navigation Mode

Hello

 

I have a problem the same as yours, but I cant apply with my code. Could you show me , please ?

 

Thanks in advance!

Developer
Posts: 49
Registered: ‎06-02-2009
My Device: Curve8530, Curve8900, Storm9500

Re: BrowserField 2: Navigation Mode

Please use  the following code sample

 

 

public class TestScreen extends MainScreen{

 

        // override the invokeAction method

        public boolean invokeAction(int action) {

            Field f = getFieldWithFocus();           

 

            // check the f to find out focus

 

            // set focus on any focusable field

            myfield.setFocus();
            
             // return super.invokeAction(action);
             return true;
        }

 

}