Hi!
Currenty I’m trying to create a registration form to practive navigating between views. I’ve got 3 views: DefaultView, LoginLayout and RegisterLayout. The problem is that I can’t switch between them and I can’t even set the DefaultView as a default one.
1st question: what is the second parameter in Navigation constructor? I used this one, but I think it’s not correct:
Navigator navigator = new Navigator(this, defaultView) → where default view is a new DefaultView(), of course.
2nd question: if I don’t set the default view, it works, but sends me an error: “trying to navigate to an unknown state…”. Obviously this happens because I didn’t set the a default one, but If I set the defaultView it doesn’t work…
Here is my short code, I think I’ve explained everything and you can understand my problem. " defaultVIew" has two button and I’ve added listeners to them to navigate …
defaultView.default_sign_in.addClickListener(clickEvent → { getNavigator().navigateTo(LoginLayout.VIEW_NAME); }); defaultView.default_registration.addClickListener(clickEvent → { getNavigator().navigateTo(RegisterLayout.VIEW_NAME); }); setContent(defaultView);
Navigator navigator = new Navigator(this, defaultView);
navigator.addView(“”, DefaultView.class);
navigator.addView(LoginLayout.VIEW_NAME, LoginLayout.class);
navigator.addView(RegisterLayout.VIEW_NAME, RegisterLayout.class);
Thanks for any help.
Zsolt