View Full Version : [CLOSED] [2.0] TreePanel Context Menu Issue

16 Jul 2009, 6:18 PM
Hi guys,

It's kinda weird but in IE8, when a TreePanel's context menu contains more than two (2) items, the context menu "flickers" (appears and immediately disappears) when you try to open it.

To test, I just copied the code in the Context Menu Tree demo and added one Menu Item to the context menu.

Can anyone confirm this?

The context menu in the Context Menu Tree demo contains only two items.

Browser: IE8 (works fine in IE6, FF, and hosted mode)
GXT: 2.0
GWT: 1.6.4
OS: Windows XP

Thanks in advance.

17 Jul 2009, 2:40 AM
I cant reproduce, also not on the examples. Please post a working testcase as descripbed in the bug forum guidelines.

17 Jul 2009, 9:40 PM
Thanks for looking, sven. Below is my test code. Here's the full version number of IE I'm using, if it helps: 8.0.6001.18702.

I'm hope it's just something in my IE browser that's causing this.

Thanks a lot.

import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.store.TreeStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.menu.Menu;
import com.extjs.gxt.ui.client.widget.menu.MenuItem;
import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class TreeContextMenuTest implements EntryPoint {

public void onModuleLoad() {
LayoutContainer panel = createTree();

// Host HTML file contains div element named 'app'

LayoutContainer createTree() {
ContentPanel panel = new ContentPanel();
panel.setLayout(new FitLayout());

TreeStore<BaseModelData> store = new TreeStore<BaseModelData>();
for (int i = 0; i < 3; i++) {
BaseModelData m = new BaseModelData();
m.set("text", "Root" + i);
store.add(m, false);
for (int j = 0; j < 3; j++) {
BaseModelData n = new BaseModelData();
n.set("text", "Child" + j);
store.add(m, n, false);
TreePanel<BaseModelData> tree = new TreePanel<BaseModelData>(store);

Menu menu = new Menu();

final MenuItem newItem = new MenuItem("New");

final MenuItem editItem = new MenuItem("Edit");

// When dupItem and delItem are not added, context menu works fine
final MenuItem dupItem = new MenuItem("Duplicate");

final MenuItem delItem = new MenuItem("Delete");


// Added this code to make the test case as close as possible to my application.
// However, regardless of whether this code is commented out or not, the problem occurs.
// tree.addListener(Events.ContextMenu, new Listener<TreePanelEvent<BaseModelData>>() {
// @Override
// public void handleEvent(TreePanelEvent<BaseModelData> be) {
// BaseModelData m = be.getItem();
// if (((String)m.get("text")).startsWith("Root")) {
// newItem.enable();
// editItem.disable();
// dupItem.disable();
// delItem.disable();
// } else {
// newItem.enable();
// editItem.enable();
// dupItem.enable();
// delItem.enable();
// }
// }
// });


return panel;


18 Jul 2009, 1:47 AM
Works fine for me. I let this open to see if someone else has the same problem.

Make sure you use GWT 1.7 if testing against IE8

30 Jul 2009, 11:24 PM
Just to update, I downloaded GWT 1.7 and GXT 2.0.1 and so far the problem has not been occurring.

30 Jul 2009, 11:31 PM
ok, marking this as closed than.

31 Jul 2009, 12:15 AM
Thanks, sven.