if (view instanceof Window) { Window win = (Window) view; PageCtrl pc = (PageCtrl) win.getPage(); pc.addBeforeHeadTags("<script type=\"text/javascript\">" + "(function(i,s,o,g,r,a,m)" + "{i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){" + "(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();" + "a=s.createElement(o)," + "m=s.getElementsByTagName(o)[0];" + "a.async=1;a.src=g;m.parentNode.insertBefore(a,m)" + "})" + "(window,document,'script','//www.google-analytics.com/analytics.js','ga');" + "ga('create', " + this.trackingID + ", 'auto'); " + "ga('send', 'pageview');" + "</script>"); } else { throw new UiException("This view model must be applied from a Window component."); }
public void onPageDetached(Page page) { super.onPageDetached(page); if (_mode == MODAL && getPage() == null) leaveModal(OVERLAPPED); }
/** * Displays the encounter selection dialog. * * @param flags The encounter flags. */ public static void execute(EncounterFlag... flags) { String resource = Constants.RESOURCE_PREFIX + "encounterSelection.zul"; Window dlg = (Window) FrameworkUtil.getAttribute(resource); if (dlg == null || dlg.getPage() == null) { dlg = PopupDialog.popup(resource, true, true, false); FrameworkUtil.setAttribute(resource, dlg); } try { EncounterSelection sel = ZKUtil.findChild(dlg, EncounterSelection.class); sel.setEncounterFlags(EncounterFlag.flags(flags)); dlg.doModal(); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Displays the encounter selection dialog. * * @param flags The encounter flags. */ public static void execute(EncounterFlag... flags) { try { Window dlg = (Window) FrameworkUtil.getAttribute(SELECTION_DIALOG); if (dlg == null || dlg.getPage() == null) { dlg = PopupDialog.popup(SELECTION_DIALOG, true, true, false); FrameworkUtil.setAttribute(SELECTION_DIALOG, dlg); } MainController sel = (MainController) getController(dlg); sel.setEncounterFlags(EncounterFlag.flags(flags)); if (sel.needsInit) { sel.init(); } dlg.doModal(); } catch (Exception e) { FrameworkUtil.setAttribute(SELECTION_DIALOG, null); throw MiscUtil.toUnchecked(e); } }