Application With Navigator
Last updated
Was this helpful?
Last updated
Was this helpful?
Example code is available on .
In this tutorial we will show how to initialize Navigator
and how to implement View
.
The first two steps are the same as for the previous 'Create Simple Application'.
We need to say the plugin that we want to do annotation based URL mapping. Comment out mapping from VaadinConfig.groovy
to do that.
Now we will create a dummy service ItemService
that we will autowire in Vaadin code.
In this step we will do the following things:
Create new UI that extends DefaulUI
Use @VaadinUI
annotation to do URL mapping for MyUI
Call super.init(r)
method that will initialize the navigator
After the point mentioned above are done, we can use Views
class to open a view. Continue to the next step to learn how views are registered using @VaadinUI
annotation.
Before we use Views.enter(View)
method we need to tell the pluging where are the views and what is the URL path to them.
Add @VaadinUI
annotation to every view that should be accesible by Views.enter
method.
Run the application grails run-app
and open in a browser.