private String getWindowCloser() {
   String result = "";
   boolean isActiveForm = false;
   WebForm[] allForms = FormManager.getAll();
   // remove all closed windows except the active window
   for (int i = 0; i < allForms.length; i++) {
     WebForm form = allForms[i];
     if (form != FormManager.getActive()) {
       IWindow window = W4TContext.getWindowManager().findWindow(form);
       if (window != null && WindowManager.isClosing(window)) {
         NoscriptFormStack.getInstance().remove(form);
       }
     }
   }
   // 'close' active window
   IWindow activeWindow = WindowManager.getActive();
   if (WindowManager.isClosing(activeWindow) && !WindowManager.isClosed(activeWindow)) {
     isActiveForm = true;
     NoscriptFormStack.getInstance().remove(FormManager.getActive());
     WindowManager.setClosed(activeWindow, true);
   }
   // create meta tag to redirect to previous form
   if (isActiveForm && !NoscriptFormStack.getInstance().isEmpty()) {
     WebForm newForm = NoscriptFormStack.getInstance().pop();
     result =
         "<meta http-equiv=\"refresh\" content=\"0; url="
             + RenderUtil.createEncodedFormGetURL(newForm)
             + "\">";
   }
   return result;
 }
Esempio n. 2
0
  @Override
  public void onComponentEvent(ComponentEvent ce) {
    super.onComponentEvent(ce);
    if (ce.getEventTypeInt() == Event.ONMOUSEDOWN) {

      // dont bring to front on clicks where active is model as active window
      // may have just been opened from this click event
      Window active = manager.getActive();
      if (active != null && active != this && !active.isModal()) {
        manager.bringToFront(this);
      }
    }
  }