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
Contributor
Posts: 22
Registered: ‎11-09-2011
My Device: 9780Bold
My Carrier: DOCOMO

browserFIeld never release its focus in blackberry os5?

[ Edited ]

This is may be old question but i dont get proper solution
if it is wrong please ignore otherwise please halp me

I have one main screen with two verticleManagers

1)For browserField
2)one button

first i add successfully My Browserfield to First verticlemanger and also add button to second verticlemanager

finally two verticlemanager added to main screen.

in OS6 i dont get any problem it works fine

but in OS5 i got problem that is

> once the Browserfield is getting focus, it never release its focus so i am unable to navigate downside of the Browserfield. Means i am unable to click on blackberry advertisement Banner.i am unable to navigate down from browserfield using trackpad

this is my sample code

class browserScreen extends MainScreen
{
String url;
BrowserField browserField;
public browserScreen() {
VerticalFieldManager main_mgr=new VerticalFieldManager(){
protected void sublayout(int maxWidth, int maxHeight) {
super.sublayout(Display.getWidth(),Display.getHeight());
setExtent(Display.getWidth(),Display.getHeight());
}
};

VerticalFieldManager browserfield_mgr=new VerticalFieldManager(){
protected void sublayout(int maxWidth, int maxHeight) {
super.sublayout(Display.getWidth(),Display.getHeight()-50);
setExtent(Display.getWidth(),Display.getHeight()-50);
}
};
url="http://www.google.com";
BrowserFieldConfig browserFieldConfig = new BrowserFieldConfig();
browserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE, BrowserFieldConfig.NAVIGATION_MODE_POINTER);
browserFieldConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED,Boolean.TRUE);
browserFieldConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR,Boolean.TRUE);
browserField=new BrowserField(browserFieldConfig);
browserField.requestContent(url);
browserfield_mgr.add(browserField);
main_mgr.add(browserfield_mgr);
VerticalFieldManager button_mgr=new VerticalFieldManager(){
protected void sublayout(int maxWidth, int maxHeight) {
super.sublayout(Display.getWidth(),50);
setExtent(Display.getWidth(),50);
}
};
button_mgr.add(new SeparatorField());
ButtonField btn=new ButtonField("BUTTON MANAGER");
button_mgr.add(btn);
main_mgr.add(button_mgr);
add(main_mgr);

}
}

 


any help can be appreciated

 

Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: browserFIeld never release its focus in blackberry os5?

What you see is what happens.  You have to provide a way to move the focus off the BrowserField yourself.  I have tried a variety of mechanisms to do this, like detecting Escape in the Screen's keyChar method, the best I have found so far is to use the Menu and give the users the option of swapping focus out of the BrowserField.  In general I do not recommend sharing the Screen between a Web Field and any other.