hans-georg1
(hans-georg gloeckler)
August 30, 2018, 1:30pm
1
I am using vaadin 8 - java ee 7 and wildfly.
I want use a subwindow.
Until now i use the following working code:
I create a new Window
public class TitleDetailView extends Window {
public TitleNewView() {
I call it with:
getUI().addWindow(new TitleDetailView())
My qestion is:
Is there a possibility to make it with CDI and Navigator?
Something like this:
@CDIView("TitleNewView")
public class TitleNewView extends Window {
And use then navigator like:
Button callButton = new Button("Call", e -> UI.getCurrent().getNavigator().navigateTo("TitleNewView"));
Tatu2
(Tatu Lund)
August 30, 2018, 1:47pm
2
Navigator manages the container designated to it, so you cannot add the Window directly as a view I guess. But you could create a “proxy” view which opens the Window e.g. in enter() method when you navigate to it.
hans-georg1
(hans-georg gloeckler)
August 30, 2018, 2:01pm
3
Ohhh.
Can you perhaps give me a code snipped what you mean with proxy view.
Tatu2
(Tatu Lund)
August 31, 2018, 5:14am
4
Something like in this pattern
public class TitleDetailWindow extends Window {
public TitleDetailWindow() {
...
}
}
@CDIView("TitleNewView")
public class TitleNewView extends VerticalLayout implements View {
...
@Override
enter() {
getUI().addWindow(new TitleDetailWindow())
}
}