AnsweredAssumed Answered

Activiti-explorer and Vaadin

Question asked by variag on Feb 1, 2012
Latest reply on Jul 22, 2014 by jbarrez
Hello community,

I'm doing the first steps with Vaadin in activiti-explorer. I want insert in my form a button that if is clicked show a new window. This is my code:

public class CongressButton extends VerticalLayout{

   private static final long serialVersionUID = 1L;
   private Button open;
   private Window subwindow;
   public CongressButton(){
              // Create the window
              subwindow = new Window("A subwindow");

              // Configure the windws layout; by default a VerticalLayout
              VerticalLayout layout = (VerticalLayout) subwindow.getContent();

              // Add some content; a label and a close-button
              Label message = new Label("This is a subwindow");

              Button close = new Button("Close", new Button.ClickListener() {
                  // inline click-listener
                  public void buttonClick(ClickEvent event) {
                      // close the window by removing it from the parent window
              // The components added to the window are actually added to the window's
              // layout; you can use either. Alignments are set using the layout
              layout.setComponentAlignment(close, Alignment.TOP_RIGHT);

              // Add a button for opening the subwindow
              open = new Button("Open subwindow", new Button.ClickListener() {
                  // inline click-listener
                  public void buttonClick(ClickEvent event) {
                      if (subwindow.getParent() != null) {
                          // window is already showing
                          getWindow().showNotification("Window is already open");
                      } else {
                          // Open the subwindow by adding it to the parent window

   public Button getButton(){
      return open;

But when I click the button the following error appears:

Cause: java.lang.NullPointerException
   at com.vaadin.event.ListenerMethod.receiveEvent(
   at com.vaadin.event.EventRouter.fireEvent(
   at com.vaadin.ui.AbstractComponent.fireEvent(
   at com.vaadin.ui.Button.fireClick(
   at com.vaadin.ui.Button.changeVariables(
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(
   at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(
   at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(
   at javax.servlet.http.HttpServlet.service(
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(
   at org.apache.catalina.core.StandardWrapperValve.invoke(
   at org.apache.catalina.core.StandardContextValve.invoke(
   at org.apache.catalina.core.StandardHostValve.invoke(
   at org.apache.catalina.valves.ErrorReportValve.invoke(
   at org.apache.catalina.core.StandardEngineValve.invoke(
   at org.apache.catalina.connector.CoyoteAdapter.service(
   at org.apache.coyote.http11.Http11Processor.process(
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Caused by: java.lang.NullPointerException
   at formsExtensions.CongressButton$2.buttonClick(

   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(
   at java.lang.reflect.Method.invoke(
   at com.vaadin.event.ListenerMethod.receiveEvent(
   … 22 more

I got the code for a example of Vaadin demo page and works fine, but when I try run this in my BPMN appears this problem. I think that problem is caused because the VerticalLayout window (father window) doesn't know what is the father window but I don`t know how do that with activiti.

Thanks very much for your replies and sorry for my bad english!  :P