Hi,
Thanks for trying to help me solve this issue which I think is a very basic one!
Well, I’ve as MyUI:
[code]
import javax.servlet.annotation.WebServlet;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import biobank.view.ErrorView;
import biobank.view.LoginView;
import biobank.view.MainView;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Component;
import com.vaadin.ui.UI;
import com.vaadin.navigator.Navigator;
import com.vaadin.navigator.ViewChangeListener;
@SuppressWarnings(“serial”)
@Theme(“mytheme”)
public class MyUI extends UI implements ViewChangeListener {
Navigator navigator;
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = MosaphenUI.class)
public static class Servlet extends VaadinServlet {
}
@Override
protected void init(VaadinRequest request) {
// Create a navigator to control the views
navigator = new Navigator(this, this);
navigator.addViewChangeListener(this);
navigator.addView("", LoginView.class);
if (SecurityUtils.getSubject().isAuthenticated()) {
mv = new MainView();
getUI().getNavigator().addView("secure", new MainView());
}
navigator.setErrorView(ErrorView.class);
}
....
[/code]MainView adds for example a menubar CustomComponent like:
public class MainView extends VerticalLayout implements View {
final private StatusBar statusbar = new StatusBar();
....
addComponent(statusbar);
…
}
The MainView consists of a menubar, mainpane and the statusbar. The mainpane contains a button, and a ClickEvent handler. Now when I click that button I want to update the statusbar. How can I refer to the statusbar component within this ClickEvent handler?
This is a simple example, it becomes even more challenging when one wants to update more than one component!
I can’t find any examples on the Vaadin site how to tackle this, so I suspect I do misunderstand some basic stuff here!
Regards,
Gerard