Hi,
I’m quite disappointed with the Menubar under Vaadin 7. Two main problems :
- It’s slower :o how to improve the performance ?
- html content don’t work as it should. On the next exemple, if you click on the “test” menuItem, you will be redirected to my link with vaadin 6 but not with vaadin 7
Exemple:
Button b1 = new Button("add menu");
b1.addListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
layout.addComponent(getMenuBar());
}
});
layout.addComponent(b1);
With the “getMenuBar” function :
private MenuBar getMenuBar() {
MenuBar menuBar = new MenuBar();
menuBar.setAutoOpen(true);
menuBar.setHtmlContentAllowed(true);
menuBar.addItem("<a href=\"https://www.google.com/\">test</a>", new Command() {
@Override
public void menuSelected(MenuItem selectedItem) {
System.out.println("click");
}
});
for (int i = 0; i < 5; i++) {
MenuItem item = menuBar.addItem("root" + new Random().nextInt(),
null);
for (int j = 0; j < 10; j++) {
MenuItem subItemJ = addRandomItem(item);
for (int k = 0; k < 10; k++) {
MenuItem subItemK = addRandomItem(subItemJ);
for (int l = 0; l < 10; l++) {
MenuItem subItemL = addRandomItem(subItemK);
for (int m = 0; m < 10; m++) {
addRandomItem(subItemL);
}
}
}
}
}
System.out.println("MenuBar created");
return menuBar;
}
private MenuItem addRandomItem(MenuItem menuItem) {
return menuItem.addItem("random" + new Random().nextInt(), null);
Any idea is welcome