Nicola
11/22/2020, 10:37 PMborderpane
and the top
element is the injected MenuView, while left, right and center there are other controls. I have something like this:
class FirstView :View() {
val menu = find(MenuView::class)
override val root = borderpane {
top = menu.root
left = vbox {}
center = vbox{}
right = listview {}
}
}
class MenuView :View() {
override val root = menubar {
menu ("File") {
item("Go to SecondView").action {
replaceWith<SecondView>()
}
}
}
}
I'd like to change the entire FirstView
from the item
inside the menu, but since MenuView
is injected as top
element it only changes the top
element of FirstView
borderpane, leaving left, center and right element showing in the window.
So I need to find a way to get a reference to the currently shown View and change it directly from MenuView class, but I don't know how. Or maybe I am missing something?