Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

I can not create a window from the Menu in DashBoardDemo Vaadin

Rubén Espinoza
5 years ago Feb 28, 2017 6:54pm
Alejandro C De Baca
5 years ago Feb 28, 2017 9:23pm
Rubén Espinoza
5 years ago Feb 28, 2017 10:35pm
Alejandro C De Baca
5 years ago Mar 01, 2017 9:18am

Rubén,

I tested creating a window from the enter method of a view, and it works fine for me. But let me reiterate my point before - you don't need to create an entire view to plug into navigator if all you really want is for the new window to appear when the user clicks on the about button. Here is what I recommend:

  1. Remove ABOUT from your DashBoardViewType enum.
  2. Find the ValoMenuItemButton inner class in the DashboardMenu class.. Create another class just like this one, but that takes a window on the constructor and shows the window as part of the click listener. I call is "ValoMenuItemButton2" in the snippet below.
  3. Find the buildMenuItems() method in the DashboardMenu class. After the big for-loop over DashboardViewType.values() (before menuItemsLayout is returned), create an instance of your new class and add it to the layout:
menuItemsLayout.addComponent(new ValoMenuItemButton2(new AboutWindow()));
return menuItemsLayout;

 

Rubén Espinoza
5 years ago Mar 01, 2017 2:09pm