I have a view:
@SpringUI(path="order")
@Title("order")
public class OrderGUI extends UI{
and I would pass parameter to other:
@SpringUI(path="orderNumber")
@Title("Order number")
public class GetOrderNumber extends UI {
I tried to send parameter(orderNumber) by:
getUI().getPage().setUriFragment(orderNumber);
getUI().getPage().setLocation("orderNumber");
then it goes to /orderNumber
but when tried to catch it by:
String fragment = getPage().getUriFragment();
but
System.out.println("Fragment: " + fragment);
says that Fragment: null
How to send parameter from one Vaadin view to another?
@Edit It is close to work. I have changed my View to:
@SpringView(name = "GetOrderNumber")
@Title("Order number")
public class GetOrderNumber extends VerticalLayout implements View {
and in @SpringUI made getUI().getNavigator().navigateTo("GetOrderNumber/" + orderNumber);
it actually still throws java.lang.IllegalArgumentException: Trying to navigate to an unknown state '' and an error view provider not present
but it works. I mean all the time when I go to localhost:8080/order the
@SpringUI(path="order")
public class OrderGUI extends UI {
throws an error but then works as expected - go to view and pass parameter right. I have no idea why navigator = new Navigator(this, this);
cause an error