Simple navigator question

Hi friends,

I am using Vaadin 8 CRUD template for my project and am not able to identify how to set a view.
When i run my application, Vaadin is displaying ‘SampleCrudView’, however I want to display ‘SearchView’ first.
Can someone tell me how to make ‘SearchView’ as the first/default view?

Below is the code.


UI.java

protected void showMainView() {
addStyleName(ValoTheme.UI_WITH_MENU);
setContent(new [color=#c0392b]
MainScreen
/color);

getNavigator().navigateTo(getNavigator().getState());

}



MainScreen.java


public MainScreen(InfoLeaseUI ui) {

setSpacing(false);
setStyleName(“main-screen”);
CssLayout viewContainer = new CssLayout();
viewContainer.addStyleName(“valo-content”);
viewContainer.setSizeFull();

final Navigator navigator = new Navigator(ui, viewContainer);
navigator.setErrorView(ErrorView.class);
menu = new Menu(navigator);
menu.addView(new
SearchView()
, SearchView.VIEW_NAME, SearchView.VIEW_NAME, VaadinIcons.INFO_CIRCLE);
menu.addView(new
SampleCrudView()
, SampleCrudView.VIEW_NAME, SampleCrudView.VIEW_NAME, VaadinIcons.EDIT);
menu.addView(new AboutView(), AboutView.VIEW_NAME, AboutView.VIEW_NAME, VaadinIcons.INFO_CIRCLE);

navigator.addViewChangeListener(viewChangeListener);
addComponent(menu);
addComponent(viewContainer);
setExpandRatio(viewContainer, 1);
setSizeFull();
}

Thanks in advance,
Srini

In MainScreen.java, you could navigate to your desired default view once everything is set up properly.