10-02-2009 05:34 AM
My menu item, which is added in the full menu simply refreshes the contents of the ObjectListField that is on my screen.
When i click the "Refresh" menu item, it refreshes the contents of my ObjectListField but also pops the Context Menu.
Why is this happening? I do not want the Context menu to be displayed after i click "Refresh".
Is there a way to solve this?
Please help!!! 
10-02-2009 06:49 AM
10-02-2009 09:43 AM
I overrided the makeMenu() method of the MainScreen class.
protected void makeMenu(Menu menu,int instance) { if(instance == Menu.INSTANCE_DEFAULT) { add(refreshMenu); super.makeMenu(menu,instance); } }
This is about it. I called the superof makeMenu so that a Close menu item will be added.
10-02-2009 10:12 AM
You may want to move super.makeMenu outside of the "if" statement so that it super.makeMenu is always executed for all types of menus.
What's the code for your Refresh menu item?
10-02-2009 10:43 PM
Thanks for the advice.
As for the code in my refresh, it's just one line.
m_listField.set(fileList);
That's it.
10-19-2009 10:27 PM
Does anybody know why this happens?
10-19-2009 10:39 PM
I think you'll want to consume a click event somewhere; sadly the details of this escape me for the moment, sorry.
10-28-2009 10:47 PM
With list fields you have to capture the navigationClick and return true. CONSUME_CLICK doesn't work.
protected boolean navigationClick(int status, int time){
if(this.getLeafFieldWithFocus() == selectionList){ // selectionList is the name of your ObjectListField
// do something and return true
// selections() is a method with a switch statement that checks the index and performs an action
if(selections()) return true;
}
}