BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-11-2008, 01:28 PM   #1 (permalink)
New Member
 
Join Date: Mar 2008
Model: 8800
PIN: N/A
Carrier: att
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default objectchoicefield and "change option" menuItem focus

Please Login to Remove!

Hi,

I have multiple an objectchoicefield, and override the makeMenu function to add menuItems myself. I finally figured out how to add the "change option" item into the menu, however, when the menu comes up, the focus is not at the highest priority or ordinal menu item, instead it focused on the other menu item I have. Can someone please help!

Code:
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
import net.rim.device.api.i18n.*;

public class test extends MainScreen
{
public test()
{
String projectChoices[] = {"11th Street Painting", "12th Street Office", "1st Ave Restaurant"};
ObjectChoiceField projectOCF = new ObjectChoiceField ("Project: ", projectChoices, 0, FIELD_RIGHT);
add(projectOCF);
}

private MenuItem _doneItem = new MenuItem("Done", 10, 10)
{
public void run()
{
while(UiApplication.getUiApplication().getActiveSc reen() != null)
{
UiApplication.getUiApplication().popScreen(UiAppli cation.getUiApplication().getActiveScreen());
}
UiApplication.getUiApplication().pushScreen(new HomeScreen());
}
};

protected void makeMenu( Menu menu, int instance )
{
MenuItem defaultItem = menu.getDefault();
defaultItem.setOrdinal(1);
defaultItem.setPriority(1);
menu.deleteAll();

menu.add(defaultItem);
menu.add(_doneItem);
}
}

Last edited by suspiration : 04-11-2008 at 01:32 PM.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

10 - 50GHz Frequency Doubler RF Multiplier X2 D1550LNM SMA (F) (M) Wide Band
$695.0
10 - 50GHz Frequency Doubler RF Multiplier X2 D1550LNM SMA (F) (M) Wide Band picture20 - 40GHz Active Frequency Doubler X2 RF Multiplier ADA1020 SMA (F) (M) 20dBm
$890.0
20 - 40GHz Active Frequency Doubler X2 RF Multiplier ADA1020 SMA (F) (M) 20dBm pictureVariable Frequency Drive, Adjustable Speed VFD, 25 HP, 480 Volt, Three Phase
$1878.0
Variable Frequency Drive, Adjustable Speed  VFD, 25 HP, 480 Volt, Three Phase pictureSony Littrow Single Frequency Diode Laser 451 nm 50 mW+ for Holography
$3250.0
Sony Littrow Single Frequency Diode Laser 451 nm 50 mW+ for Holography  picture Eaton Cutler-Hammer NEW Adjustable Frequency Drive SVX9000 SVX003A1-4A1B1
$600.0
 Eaton Cutler-Hammer NEW Adjustable Frequency Drive SVX9000 SVX003A1-4A1B1 picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.