response(key, response, 0);
/** Causes a response to be sent to the client. * It is the same as <code>response(response.getOverrideKey(), response)</code> * * <p>If {@link AuResponse#getDepends} is not null, the response * depends on the existence of the component returned by * {@link AuResponse#getDepends}. * In other words, the response is removed if the component is removed. * If it is null, the response is component-independent and it is * always sent to the client. * * <p>Unlike {@link #smartUpdate}, responses are sent even if * {@link Component#invalidate()} was called. * Typical examples include setting the focus, selecting the text and so on. * * <p>It can be called only in the request-processing and event-processing * phases; excluding the redrawing phase. * * @since 5.0.2 * @see #response(String, AuResponse) */ protected void response(AuResponse response) { response(response.getOverrideKey(), response); }
if (Events.ON_CLIENT_INFO.equals(evtnm)) { desktop.setAttribute("org.zkoss.desktop.clientinfo.enabled", true); response(new AuClientInfo(desktop)); } else if (Events.ON_PIGGYBACK.equals(evtnm)) { ((DesktopCtrl) desktop).onPiggybackListened(this, true);
private void onListenerChange(Desktop desktop, boolean listen) { if (listen) { if (Events.isListened(this, Events.ON_CLIENT_INFO, false)) { //asap+deferrable response(new AuClientInfo(desktop)); getDesktop().setAttribute("org.zkoss.desktop.clientinfo.enabled", true); //We always fire event not a root, since we don't like to //check when setParent or setPage is called } if (Events.isListened(this, Events.ON_PIGGYBACK, false)) ((DesktopCtrl) desktop).onPiggybackListened(this, true); if (Events.isListened(this, Events.ON_VISIBILITY_CHANGE, false)) getDesktop().setAttribute("org.zkoss.desktop.visibilitychange.enabled", true); } else { if (!Events.isListened(this, Events.ON_PIGGYBACK, false)) ((DesktopCtrl) desktop).onPiggybackListened(this, false); } }