Hi,
I am trying to have a typical reporting application with a horizontal split panel.
The left side will have all the buttons (typically like the Vaadin 7 dashboard demo).
Based on the clicks, the right side view should be rendered.
What I am not able to wrap my head around is, how do I keep the left side static and just replace the second component as a view in vaadin 7.
I am sure, I am missing something very trivial. Any help is greatly appreciated.
If I just traverse to the root of my application:
I get the typical empty view error:
javax.servlet.ServletException: java.lang.IllegalArgumentException: Trying to navigate to an unknown state '' and an error view provider not present
com.vaadin.server.VaadinServlet.handleServiceException(VaadinServlet.java:580)
com.vaadin.server.VaadinServlet.service(VaadinServlet.java:343)
com.vaadin.server.VaadinServlet.service(VaadinServlet.java:201)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
if I add, the code shown in buildMainView, it straight away takes me to the view page (obviously) without the static content.
public class MYUI extends UI {
Navigator navigator;
// All the View Names
protected static final String CONFIG_COMPARISON= "configComparison";
// End View Names
HorizontalLayout root = new HorizontalLayout();
HashMap<String, Class<? extends View>> navigatorHolder = new HashMap<String, Class<? extends View>>() {
{
put(CONFIG_COMPARISON, ConfigurationPage.class);
}
};
@Override
public void init(VaadinRequest request) {
navigator = new Navigator(this, this);
for (String view : navigatorHolder.keySet()) {
navigator.addView(view, navigatorHolder.get(view));
}
HorizontalSplitPanel hz = new HorizontalSplitPanel();
MainViewPage mv = new MainViewPage();
hz.setFirstComponent(mv);
setContent(hz);
buildCommonView();
setSizeFull();
}
private void buildCommonView() {
String f = Page.getCurrent().getUriFragment();
if (f != null && f.startsWith("!")) {
f = f.substring(1);
}
if (f == null || f.equals("") || f.equals("/")) {
navigator.navigateTo(CONFIG_COMPARISON);
}
}
Any Help/Advice/Pointers greatly appreciated.
Thanks,
Ach