What I need is to call same controller method from two different views. For example I need to call
controller.getProducts()
from ProductView.class as well as from StockView.class
I call this controller.getProducts()
to populate data inside a tableView and comboBox using
runAsync{
controller.getProducts()
}ui{
items = it
}
But this works only for one time. Whichever view I visit first this works. But for the second view this does not work. I would like to mention , this bellow code works .
runAsync{
val it = controller.getProducts()
runLater{
items =it
}
Please solve my puzzle