/** Process the onModal event by making itself a modal window. */ public void onModal() { doModal(); }
@Listen("onClick = #reorderBtn") public void onEditorOpen(Event e) { Window win = (Window) Executions.createComponents("/lbMenu.zul", this.getSelf(), null); win.doModal(); }
/** * Show detail for specified list item. * * @param li The list item. */ protected void showDetail(Listitem li) { @SuppressWarnings("unchecked") M modelObject = li == null ? null : (M) li.getValue(); String detail = modelObject == null ? null : getDetail(modelObject); if (!StringUtils.isEmpty(detail)) { if (getShowDetailPane()) { detailView.setContent(detail); } else { Map<Object, Object> map = new HashMap<Object, Object>(); map.put("title", detailTitle); map.put("content", detail); map.put("allowPrint", getAllowPrint()); try { ((Window) ZKUtil.loadZulPage(Constants.RESOURCE_PREFIX + "resourceListDetail.zul", null, map)).doModal(); } catch (Exception e) { PromptDialog.showError(e); } } } }
Events.postEvent(Events.ON_MODAL, this, null); else doModal(); } else if ("highlighted".equals(name)) doHighlighted();
private void doModal(Page page, String url) { final Execution exec = Executions.getCurrent(); final Object[] urls = parseUrl(url); final Component modalwin = exec.createComponents((String) urls[0], null, (Map) urls[1]); if (!(modalwin instanceof Window)) { throw new UiException("The page must enclosed with a Window component. Check url definition: " + url); } modalwin.setPage(page); ((Window) modalwin).doModal(); }
/** * Handles a deferred request to show the dialog. * * @param event The onShow event. * @throws Exception Unspecified exception. */ public void onShow(Event event) throws Exception { root.removeAttribute(Constants.SELECTED_PATIENT_ATTRIB); lstSearch.clearSelection(); onCheck$rgrpLists(); Events.echoEvent(Events.ON_FOCUS, root, null); if (!root.inModal()) { root.doModal(); } }
/** * 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); } }
/** Sets the mode to overlapped, popup, modal, embedded or highlighted. * * @see #setMode(String) */ public void setMode(int mode) { switch (mode) { case POPUP: doPopup(); break; case OVERLAPPED: doOverlapped(); break; case EMBEDDED: doEmbedded(); break; case MODAL: if (isEventThreadEnabled(false)) Events.postEvent(Events.ON_MODAL, this, null); else doModal(); break; case HIGHLIGHTED: doHighlighted(); break; default: throw new WrongValueException("Unknown mode: " + mode); } }
/** * 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); } }