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
Contributor
Posts: 32
Registered: ‎10-03-2011
My Device: 9900
My Carrier: developer

How to set focus on button in browserfield

hi all,

 

   In browserfield i have htmlcontent, in that i need focus on button.

I tried in different ways i.e,

 

   x-blackberry-initialFocus = 'true'

   blacklberry.focus.setFocus(id);

 

document.getEelementById('btnid').focus();

<button id='btnid'>clickme</button>

 

but none of these are not working.

Is there any way to set the focus on button.

plz guide me.

 

 

 

 

 

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: How to set focus on button in browserfield

Do you mean focus with a cursor or focus with navigation mode?



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Contributor
Posts: 32
Registered: ‎10-03-2011
My Device: 9900
My Carrier: developer

Re: How to set focus on button in browserfield

[ Edited ]

hi,

 

  Focus shold be on button on page load.On touch screen cursor is not coming.then how can i set focus for that button on browserfield

 

 

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: How to set focus on button in browserfield

Hi kranthi4one,

 

I misread something yesterday, in that you're using your own browserfield and not webworks? I'm just wondering if there is a particularly good reason for this? All of the blackberry focus stuff I believe is webworks specific and not native to the browserfield at all.

 

As per the second set of code, that should work. Was "document.getEelementById('btnid').focus();" in your onLoad event?



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Contributor
Posts: 32
Registered: ‎10-03-2011
My Device: 9900
My Carrier: developer

Re: How to set focus on button in browserfield

Hi,

 

Thanks for the reply. I am using BrowserField as a java library in Webworks application. The reason for using it as a library is , to handle the navigation request and the data sent by third party web page. Before opening a third paty web page i have to open a html content in the BrowserField. This html content has a button where i need to set the focus.

The problem i am facing is only with touch screen including 9900.

 

Please guide me on this.

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: How to set focus on button in browserfield

Hi kranthi4one,

 

You never answered my question, was the JS in your onload event, or how was it invoked?



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)