PDA

View Full Version : CheckMenuItem in Grid columns menu not working



cbruno
14 Jun 2009, 9:39 PM
I am extending the GridView class and overriding the createContextMenu function to create a custom menu for the grid columns. I add a submenu of radio checkmenuitems, but the states do not change when selected. Anyone know why this doesnt work? I am using the latest 2.0 RC:


item = new MenuItem();
item.setText("Data Format");
final Menu formatmenu = new Menu();


for(int i = 0; i < data_formats.length; i++){

CheckMenuItem checkitem = new CheckMenuItem();
checkitem.setText(data_formats[i]);
if(i == 0){checkitem.setChecked(true);}
checkitem.setGroup("dataformat");
checkitem.addSelectionListener(df_listener);
formatmenu.add(checkitem);

}

item.setSubMenu(formatmenu);

cbruno
14 Jun 2009, 9:40 PM
Note: The code above does not work even with the line

checkitem.addSelectionListener(df_listener);


taken out.