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: 52
Registered: ‎07-17-2008
My Device: Not Specified

Setting focus on a Dialog screen

I have added two CheckBoxFields to a D_OK_CANCEL type Dialog screen.  90% of the times the user should be fine with the default ticks on these CheckBoxFields, so I want to set the default focus to OK button.  How can I accomplish this? 

 

I have used 

 

 

setDefault(Dialog.D_OK);

 

but still the focus is always set to the first CheckBoxField.

 

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

Re: Setting focus on a Dialog screen

Dialog.D_OK is the 'magic number' used to specify a Dialog type.  I think you want Dialog.OK.  Not tested myself, but I suspect it will work for you.