text: Q:
  
  Open a sub window with link?
  
  I'm using Vaadin7, and I looking for how to open a sub-window using link.
  I'm trying this, but not work.
  
  public class MyWindow extends Window{
    public MyWindow(){
       super("MyWindow");
       center();
       setModal(true);
       setClosable(false);
      setDraggable(false);
      setResizable(false);
   }
  
  }
  public class OpenMyWindow extends Window{
         private Link link;
   public MyWindow(){
      super("OpenMyWindow");
      center();
      setModal(true);
      setClosable(false);
      setDraggable(false);
      setResizable(false);
  
       link = new Link("Open Window", new ExternalResource("MyWindow");
       VerticalLayout v = new VerticalLayout();
        setContent(v);
        v.addComponent(link);
   } 
  
  }
  
  Any idea how to do work ?
  thanks.
  
  A:
  
  You shouldn't use a link for opening a sub window. Use a button instead. If it has to look like a link, then you can style the button as a link.
  Button button = new Button("Click Me!");
  button.setStyleName(Button.STYLE_LINK);
  button.addClickListener(new Button.ClickListener() {
      public void buttonClick(ClickEvent event) {
          // open your sub window here
          Window sub = new Window("Subwindow");
          v.addWindow(sub);
      }
  });
  
  v.addComponent(button);
  
  Hope that helps.
  
  