public void render(Page page, Writer out) throws IOException { out.write(HtmlPageRenders.outLangStyleSheets(_exec, null, null)); out.write(HtmlPageRenders.outLangJavaScripts(_exec, null, null)); if (_pageDOM) { HtmlPageRenders.outPageContent(_exec, page, out, false); return; } final Desktop desktop = _exec.getDesktop(); out.write("<script class=\"z-runonce\" type=\"text/javascript\">zkpb('"); out.write(page.getUuid()); out.write("','"); out.write(desktop.getId()); out.write("','"); out.write(getContextURI()); out.write("','"); out.write(desktop.getUpdateURI(null)); out.write("','"); out.write(desktop.getRequestPath()); out.write('\''); String style = page.getStyle(); if (style != null && style.length() > 0) { out.write(",{style:'"); out.write(style); out.write("'}"); } out.write(");zkpe();</script>\n"); for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) { HtmlPageRenders.outStandalone(_exec, root, out); } }
if(p.getFirstRoot() == null) { continue; if (p.getFirstRoot() == null) { foundComponents = new LinkedList<Component>(); } else {
return page.getFirstRoot(); //the first root assumed
public void afterProcessEvent(Event event) throws Exception { _eis.afterProcessEvent(event); _wapp.getConfiguration().afterProcessEvent(event); if (Events.ON_DESKTOP_RECYCLE.equals(event.getName())) { if (_bookmark.length() > 0) addResponse(new AuBookmark(_bookmark)); l_out: for (Page page : _pages) for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) if (Events.isListened(root, Events.ON_CLIENT_INFO, false)) { setAttribute("org.zkoss.desktop.clientinfo.enabled", true); addResponse(new AuClientInfo(this)); break l_out; } l_out: for (Page page : _pages) for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) if (Events.isListened(root, Events.ON_VISIBILITY_CHANGE, false)) { setAttribute("org.zkoss.desktop.visibilitychange.enabled", true); break l_out; } } }
out.write("},["); for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) ((ComponentCtrl) root).redraw(out);
public void onPiggyback() { //Note: we don't post ON_PIGGYBACK twice in an execution //(performance concern and back-compatibility). if (_piggybackListened && Executions.getCurrent().getAttribute(ATTR_PIGGYBACK_POSTED) == null) { for (Page page : _pages) { if (Executions.getCurrent().isAsyncUpdate(page)) { //ignore new created pages for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) { if (Events.isListened(root, Events.ON_PIGGYBACK, false)) { //asap+deferrable Events.postEvent(new Event(Events.ON_PIGGYBACK, root)); Executions.getCurrent().setAttribute(ATTR_PIGGYBACK_POSTED, Boolean.TRUE); } } } } } if (!_schedInfos.isEmpty()) Events.postEvent(ON_SCHEDULE, _dummyTarget, null); //we could not process them here (otherwise, event handling, thread //might not work) //Thus, we post an event and handle it in _dummyTarget if (_spush != null) _spush.onPiggyback(); }
for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) addAllComponents(root);
/** Renders the page if {@link Page#isComplete} is true. * In other words, the page content contains HTML/BODY tags. */ protected void renderComplete(Execution exec, Page page, Writer out) throws IOException { write(out, HtmlPageRenders.outFirstLine(exec, page)); //might null write(out, HtmlPageRenders.outDocType(exec, page)); //might null HtmlPageRenders.setContentType(exec, page); for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) ((ComponentCtrl) root).redraw(out); write(out, HtmlPageRenders.outHeaderZkTags(exec, page)); writeln(out, HtmlPageRenders.outUnavailable(exec)); } }
private ComponentMatchCtx buildRootCtx() { Component rt = _root == null ? _page.getFirstRoot() : _root; if (_posOffset > 0) { Selector selector = _selectorList.get(0);
private ComponentMatchCtx buildRootCtx() { Component rt = _root == null ? _page.getFirstRoot() : _root;
richlet.service(page); for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) { doAfterCompose(composer, root); afterCreate(exec, new Component[] { root });