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: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Focus issue on 6.0+ devices

Hi all,

In my app i have a labelfield below that i'm using a browserfield. I set Focusable property for the labelfield, but it seems not working in 6.0+ devices and it is working fine in 5.0 devices. 

Developer
Posts: 172
Registered: ‎01-17-2011
My Device: 9500 series
My Carrier: Airtel

Re: Focus issue on 6.0+ devices

Please Share Code.
Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: Focus issue on 6.0+ devices

[ Edited ]

authorField = new CustomLabelFieldForPopup(storyParser.storyData.get("author").toString(),Field.FOCUSABLE)
{
protected boolean navigationClick(int status, int time)
{
loadNewsList(String.valueOf(storyParser.storyData.get("authorArticle")));
return true;
}
};

authorField.setPadding(topField.getTop()+topField.getContentHeight()+10, 0, 5, 10);
authorField.setFont(Font.getDefault());
scrollContainer.add(authorField);

add(scrollContainer);

browserFieldConfig = new BrowserFieldConfig();
browserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_CARET );
myBrowserField = new BrowserField(browserFieldConfig);
String content="";
if(screenwidth ==320 || screenwidth ==360){
content ="<html><head></head><body>"+storyParser.storyData.get("description")+"</body></html>";

}else{
content ="<html><head><style> body {font-size:22px;} </style></head><body>"+storyParser.storyData.get("description")+"</body></html>";
}
myBrowserField.displayContent(content,"http://localhost");
scrollContainer.add(myBrowserField);

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

Re: Focus issue on 6.0+ devices

Am I right in saying that the issue here is that in OS 6.0, the focus stays on the BrowserField and you can't get it to the LabelField?

 

Try displaying this screen without the BrowserField to confirm and/or put another focusable Field in the place of the LabelField (say a BasicEditField) to prove this. 

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: Focus issue on 6.0+ devices

Without BrowserField i'm able to get the focus for labelfield. After that i changed the labelfield with  basiceditfield..... still having the focus issue. So you saying there is no workaround to set the focus.

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

Re: Focus issue on 6.0+ devices

Sorry, I am not an expert in this.  I was just clarifying the problem. 

 

To summarize, you can not get focus off a BrowserField in OS 6.0?  But the code works fine in OS 5.0?

 

I believe I have struck a similar problem and ended up supplying a menu key that moved the focus off the BrowserField.