public void onPageAttached(Page newpage, Page oldpage) { super.onPageAttached(newpage, oldpage); Component rootParent = ComponentsCtrl.getRootParent(); final Radiogroup rg = getRadiogroup(); // ZK-3818: update selected index in the callback if (!_explictGroup) { _group = this.getRadiogroup(); } if (rg != null && rootParent instanceof ComponentCtrl && (!Components.isAncestor(rootParent, rg) || rootParent == rg)) { ((ComponentCtrl) rootParent).addCallback(AFTER_CHILD_ADDED, new Callback<Component>() { public void call(Component rootParent) { rg.fixOnAdd(Radio.this, false); } }); } } }
@Override public void onPageDetached(Page page) { super.onPageDetached(page); //B65-ZK-1768 remove the radio from the radiogroup in case it is an external radio final Radiogroup rg = getRadiogroup(); if (rg != null) { rg.removeExternal(this); } // ZK-3818: update selected index in the callback if (!_explictGroup) { _group = null; } Component rootParent = ComponentsCtrl.getRootParent(); if (rg != null && rootParent instanceof ComponentCtrl && (!Components.isAncestor(rootParent, rg) || rootParent == rg)) { ((ComponentCtrl) rootParent).addCallback(AFTER_CHILD_REMOVED, new Callback<Component>() { public void call(Component rootParent) { rg.fixOnRemove(Radio.this); } }); } }
/** * Removes the relation points between shadow host and this shadow element. */ public void detach() { Component prevhost = getShadowHostIfAny(); if (_host != null) { ComponentCtrl host = (ComponentCtrl) _host; _host = null; // clear first to avoid endloop ((ComponentCtrl) host).removeShadowRoot(this); onHostDetached((Component) host); } setParent0(null); if (prevhost != null) { if (prevhost.getDesktop() != null) prevhost.getDesktop().getWebApp().getConfiguration().afterShadowDetached(this, prevhost); else { final ShadowElement se = this; ((ComponentCtrl) prevhost).addCallback(AFTER_PAGE_DETACHED, new Callback<Component>() { public void call(Component host) { host.getDesktop().getWebApp().getConfiguration().afterShadowDetached(se, host); } }); } } }
} else { final ShadowElement se = this; ((ComponentCtrl) host).addCallback(AFTER_PAGE_ATTACHED, new Callback<Component>() { public void call(Component host) { host.getDesktop().getWebApp().getConfiguration().afterShadowAttached(se, host);
((ComponentCtrl) comp).addCallback(ComponentCtrl.AFTER_PAGE_ATTACHED, new Callback() { public void call(Object data) { try {
((ComponentCtrl) comp).addCallback(ComponentCtrl.AFTER_PAGE_ATTACHED, new Callback() { public void call(Object data) { try {