Package org.zkoss.zul

Examples of org.zkoss.zul.Window


 
  private void renderPopup(Map model, HttpServletRequest request,
  HttpServletResponse response, Execution exec, Component popTarget) throws Exception {
    // Determine the path for the request dispatcher.
    String dispatcherPath = prepareForRendering(request, response);
    final Window popupWin = (Window) exec.createComponents(POPUP_TEMPLATE, null, null);
   
    //store flow context information into popup window
    ZKProxy.getProxy().setAttribute(exec, ZkFlowContextManager.FLOW_POPUP_WINDOW, popupWin);
    ZkFlowContextManager.storeFlowContext(exec);
   
    //Some page might be composed with Composition, so always prepare it

    //Bug: If the dispatcherPath page contains zhtml <h:html> + <h:body>,
    //  the new created <h:body> will replace the page's _defparent. Then
    //  in fragment cleanup, the <h:html> is detached so the <h:body> does
    //  not attached to the page any more (because its parent h:html is
    //  detached) but the _defparent is still the <h:body>. The state of
    //  the page screwed up and things going crazy.
    //exec.setAttribute(Composition.PARENT, popupWin);
    //exec.createComponents(dispatcherPath, popupWin, null);
   
 
    //keep only the fragment part
    String[] fragments = (String[]) model.get(View.RENDER_FRAGMENTS_ATTRIBUTE);
    if (fragments != null && fragments.length > 0) {
      Component[] comps = exec.createComponents(dispatcherPath, null);
     
      //remember flow model stored in request attributes to current Desktop
      //so DelegatingVariableResolver can see it!
      final Map fragmentMap = prepareFragmentMap(new HashMap(), Arrays.asList(comps));
     
      //remove all
      //popupWin.getChildren().clear();

      //attach fragment only
      for (int j = 0; j < fragments.length; ++j) {
        final String fragment = fragments[j];
        final Component fragmentComp = (Component) fragmentMap.get(fragment);
        if (fragmentComp != null) {
          popupWin.appendChild(fragmentComp);
        }
      }
     
      //prepare a data binder for the popupWin
      final AnnotateDataBinder binder = new AnnotateDataBinder(popupWin, true);
      popupWin.setAttribute("binder", binder, true);

      //redraw
      popupWin.invalidate();
    }
  }
View Full Code Here


    Label label  =new Label();
    Events.sendEvent(label, new Event("onTest",label));
  }
 
  public void onClick$button2(){
    Window inner  =new Window();
    Window outer = new Window();
    outer.appendChild(inner);
    Events.sendEvent(inner, new Event("onTest",inner));
  }
View Full Code Here

   *
   * @param event
   * @throws InterruptedException
   */
  public void onClick$btnPrint(Event event) throws InterruptedException {
    final Window win = (Window) Path.getComponent("/outerIndexWindow");
    new BranchSimpleDJReport(win);
  }
View Full Code Here

    if (timer == null) {
      this.timer = new Timer();

      // timer doesn't work without a page as parent
      Window outerIndexWindow = (Window) Path.getComponent("/outerIndexWindow");
      this.timer.setPage(outerIndexWindow.getPage());
      // 60000 = 60 sec.
      this.timer.setDelay(20000);
      this.timer.setRepeats(true);
      this.timer.addEventListener("onTimer", new EventListener() {
View Full Code Here

   *
   * @throws IOException
   * @throws InterruptedException
   */
  public void onClick$btnUserSettings() throws IOException, InterruptedException {
    Window win = null;
    Window parentWin = (Window) Path.getComponent("/outerIndexWindow");

    try {
      win = (Window) Executions.createComponents("/WEB-INF/pages/sec_user/mySettings.zul", parentWin, null);
    } catch (Exception e) {
      // TODO: handle exception
View Full Code Here

   *
   * @throws IOException
   * @throws InterruptedException
   */
  public void onClick$btnTestMain() throws InterruptedException {
    Window win = null;
    Window parentWin = (Window) Path.getComponent("/outerIndexWindow");

    try {
      win = (Window) Executions.createComponents("/WEB-INF/pages/test/testMain.zul", parentWin, null);
    } catch (Exception e) {
      // TODO: handle exception
View Full Code Here

   *
   * @param event
   * @throws InterruptedException
   */
  public void onClick$button_UserList_PrintUserList(Event event) throws InterruptedException {
    final Window win = (Window) Path.getComponent("/outerIndexWindow");
    new UserSimpleDJReport(win);
  }
View Full Code Here

   *
   * @param event
   * @throws InterruptedException
   */
  public void onClick$button_SecRightList_PrintRightList(Event event) throws InterruptedException {
    final Window win = (Window) Path.getComponent("/outerIndexWindow");
    new SecRightSimpleDJReport(win);
  }
View Full Code Here

   *
   * @param event
   * @throws InterruptedException
   */
  public void onClick$btnPrint(Event event) throws InterruptedException {
    final Window win = (Window) Path.getComponent("/outerIndexWindow");
    new OfficeSimpleDJReport(win);
  }
View Full Code Here

   *
   * @param event
   * @throws InterruptedException
   */
  public void onClick$button_SecGroupList_PrintGroupList(Event event) throws InterruptedException {
    final Window win = (Window) Path.getComponent("/outerIndexWindow");
    new SecGroupSimpleDJReport(win);
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Window

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.