If you right click on a menu item and select open in new tab or window, the window will open in the root of your application, we wanted to take advantage of this but it seems to be not over-redable.
In the MenuItem.onRender code:
Code:
@Override
protected void onRender(Element target, int index) {
super.onRender(target, index);
setElement(DOM.createAnchor(), target, index);
if (GXT.isAriaEnabled()) {
Accessibility.setRole(getElement(), Accessibility.ROLE_MENUITEM);
} else {
getElement().setPropertyString("href", "#");
}
String s = itemStyle + (subMenu != null ? " x-menu-item-arrow" : "");
addStyleName(s);
if (widget != null) {
setWidget(widget);
} else {
setText(text);
}
if (subMenu != null) {
Accessibility.setState(getElement(), "aria-haspopup", "true");
}
}
The "getElement().setPropertyString("href", "#");" line is providing this functionality. There doesn't seem to be a way to override this without overriding the whole onRender method; which we'd prefer not to do. Is there a preferred way to do this?