Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.Execution


        _model = model;
        initDataListener();
      }

      final Execution exec = Executions.getCurrent();
      final boolean defer = exec == null ? false : exec.getAttribute("zkoss.Listbox.deferInitModel_"+getUuid()) != null;
      final boolean rod = evalRod();
      //Always syncModel because it is easier for user to enfore reload
      if (!defer || !rod) { //if attached and rod, defer the model sync
        getDataLoader().syncModel(-1, -1);
      } else if (inPagingMold()) {
View Full Code Here


  }

  public void onPageAttached(Page newpage, Page oldpage) {
    super.onPageAttached(newpage, oldpage);
    if (oldpage == null) { // mark as a new attached Listbox
      final Execution exec = Executions.getCurrent();
      exec.setAttribute("zkoss.Listbox.deferInitModel_"+getUuid(), Boolean.TRUE);
      exec.setAttribute("zkoss.Listbox.attached_"+getUuid(), Boolean.TRUE);
      // prepare a right moment to init Listbox (must be as early as possible)
      this.addEventListener("onInitModel", _modelInitListener = new ModelInitListener());
      Events.postEvent(20000, new Event("onInitModel", this)); //first event to be called
    }
  }
View Full Code Here

   * @return A clone of this Composer.
   * @since 3.5.2
   */
  public Object willClone(Component comp) {
    try {
      final Execution exec = Executions.getCurrent();
      final int idcode = System.identityHashCode(comp);
      Composer composerClone = (Composer) exec.getAttribute(COMPOSER_CLONE+idcode);
      if (composerClone == null) {
        composerClone = (Composer) Classes.newInstance(getClass(), null);
        exec.setAttribute(COMPOSER_CLONE+idcode, composerClone);
       
        //cannot call doAfterCompose directly because the clone
        //component might not be attach to Page yet
        comp.addEventListener(ON_CLONE_DO_AFTER_COMPOSE, new CloneDoAfterCompose());
        Events.postEvent(new Event(ON_CLONE_DO_AFTER_COMPOSE, comp, composerClone));
View Full Code Here

      final WebAppCtrl wappc = (WebAppCtrl)wapp;
      final UiEngine uieng = wappc.getUiEngine();
      final Desktop desktop = wappc.getDesktopCache(sess).getDesktop(dtid);
      final DesktopCtrl desktopCtrl = (DesktopCtrl)desktop;

      final Execution oldexec = Executions.getCurrent();
      final Execution exec = new ExecutionImpl(
        _ctx, request, response, desktop, null);
      uieng.activate(exec);

      final Configuration config = wapp.getConfiguration();
      boolean err = false;
View Full Code Here

  }
  private static Page getPage(Component comp) {
    Page page = comp.getPage();
    if (page != null) return page;

    final Execution exec = Executions.getCurrent();
    return exec != null ? ((ExecutionCtrl)exec).getCurrentPage(): null;
  }
View Full Code Here

   * while null is a valid value.
   */
  protected Object getFromNamespace(String name) {
    final Scope scope = getCurrent();
    if (scope != null) { //null means no scope allowed!
      final Execution exec = Executions.getCurrent();
      if (exec != null && exec != scope) {
        Object val = exec.getAttribute(name);
        if (val != null /*|| exec.hasAttribute(name)*/) //request's hasAttribute same as getAttribute
          return val;
      }

      if (scope instanceof Component) {
View Full Code Here

   *
   * @param ref the object,either page, component, or null.
   * It is passed to {@link #evaluate}
   */
  public VariableResolver getVariableResolver(Object ref) {
    final Execution exec = Executions.getCurrent();
    VariableResolver resolver = exec.getVariableResolver();
    if (resolver == null) {
      final RequestContext rc = RequestContexts.getCurrent();
      if (rc != null)
        resolver = rc.getVariableResolver();
      if (resolver == null)
View Full Code Here

    sess.setAttribute(Attributes.GAE_FIX, new Integer(0)); //enforce GAE to write session
    ((SessionCtrl)sess).notifyClientRequest(keepAlive);

//    if (log.debugable()) log.debug("AU request: "+aureqs);
    final DesktopCtrl desktopCtrl = (DesktopCtrl)desktop;
    final Execution exec =
      new ExecutionImpl(_ctx, request, response, desktop, null);
    if (sid != null)
      ((ExecutionCtrl)exec).setRequestId(sid);

    final AuWriter out = AuWriters.newInstance();
View Full Code Here

   * @param deviceType the device type. If null, ajax is assumed.
   */
   public static String outZkHtmlTags(ServletContext ctx,
   HttpServletRequest request, HttpServletResponse response,
   String deviceType) {
     Execution old = Executions.getCurrent();
     Execution exec = new ExecutionImpl(ctx, request, response, null, null);
    ExecutionsCtrl.setCurrent(exec);
     ((ExecutionCtrl)exec).onActivate();
    try {
      return HtmlPageRenders.outZkTags(exec,
        WebManager.getWebManager(ctx).getWebApp(),
View Full Code Here

   * @param deviceType the device type. If null, ajax is assumed.
   */
  public static final String outDeviceStyleSheets(ServletContext ctx,
   HttpServletRequest request, HttpServletResponse response,
   String deviceType) {
     Execution old = Executions.getCurrent();
     Execution exec = new ExecutionImpl(ctx, request, response, null, null);
    ExecutionsCtrl.setCurrent(exec);
     ((ExecutionCtrl)exec).onActivate();
    try {
      return HtmlPageRenders.outLangStyleSheets(exec,
        WebManager.getWebManager(ctx).getWebApp(),
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.Execution

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.