public Component[] createComponents(String uri, Component parent, Component insertBefore, VariableResolver resolver, Map<?, ?> arg) { return exec().createComponents(uri, parent, insertBefore, resolver, arg); }
public Component createComponents(PageDefinition pagedef, Component parent, Component insertBefore, VariableResolver resolver) { return exec().createComponents(pagedef, parent, insertBefore, resolver); }
public Component createComponents(PageDefinition pagedef, Component parent, Map<?, ?> arg) { return exec().createComponents(pagedef, parent, arg); }
public Component createComponents(String uri, Component parent, Component insertBefore, VariableResolver resolver) { return exec().createComponents(uri, parent, insertBefore, resolver); }
public Component[] createComponents(String uri, Map<?, ?> arg) { return exec().createComponents(uri, arg); }
public Component createComponents(String uri, Component parent, Map<?, ?> arg) { return exec().createComponents(uri, parent, arg); }
public Component[] createComponents(PageDefinition pagedef, Map<?, ?> arg) { return exec().createComponents(pagedef, arg); }
public Component[] createComponents(String uri, Page page, VariableResolver resolver, Map<?, ?> arg) { return exec().createComponents(uri, page, resolver, arg); }
/** Creates components from a page file specified by an URI. * Shortcut to {@link Execution#createComponents(String, Component, Map)}. * * @param parent the parent component, or null if you want it to be * a root component. If parent is null, the page is assumed to be * the current page, which is determined by the execution context. * In other words, the new component will be the root component * of the current page if parent is null. * @param arg a map of parameters that is accessible by the arg variable * in EL, or by {@link Execution#getArg}. * Ignored if null. * @return the first component being created. * @see #createComponents(PageDefinition, Component, Map) */ public static final Component createComponents(String uri, Component parent, Map<?, ?> arg) { return getCurrent().createComponents(uri, parent, arg); }
/** Creates components based on the specified page definition. * Shortcut to {@link Execution#createComponents(PageDefinition, Component, Map)}. * * @param pagedef the page definition to use. It cannot be null. * @param parent the parent component, or null if you want it to be * a root component. If parent is null, the page is assumed to be * the current page, which is determined by the execution context. * In other words, the new component will be the root component * of the current page if parent is null. * @param arg a map of parameters that is accessible by the arg variable * in EL, or by {@link Execution#getArg}. * Ignored if null. * @return the first component being created. * @see #createComponents(String, Component, Map) */ public static final Component createComponents(PageDefinition pagedef, Component parent, Map<?, ?> arg) { return getCurrent().createComponents(pagedef, parent, arg); }
/** Creates components that belong to the given page * from a page file specified by an URI. * * @param page the page, or null if you want it to attach the created components. * @param resolver the variable resolver used to resolve variables. * Ignored if null. * @param arg a map of parameters that is accessible by the arg variable * in EL, or by {@link Execution#getArg}. * Ignored if null. * @return all top-level components being created. * @see #createComponents(WebApp, PageDefinition, Map) * @see #createComponentsDirectly(WebApp, String, String, Map) * @see #createComponentsDirectly(WebApp, Document, String, Map) * @see #createComponentsDirectly(WebApp, Reader, String, Map) * @since 8.0.1 */ public static Component[] createComponents(String uri, Page page, VariableResolver resolver, Map<?, ?> arg) { return getCurrent().createComponents(uri, page, resolver, arg); }
public void doInit(Page page, Map<String, Object> args) throws Exception { //first called doInit, last called doAfterCompose final Execution exec = Executions.getCurrent(); if (exec.getAttribute(RESOLVE_COMPOSITION) == null) { exec.setAttribute(RESOLVE_COMPOSITION, this); } final Component parent = (Component) exec.getAttribute(PARENT); for (Object arg : args.values()) exec.createComponents((String) arg, parent, null); }
/** Creates components that don't belong to any page * from the specified page definition. * * <p>Unlike {@link #createComponents(PageDefinition,Component,Map)}, * this method can be invoked without the current execution, such as * a working thread. In this case, the wapp argument must be specified. * * @param wapp the Web application. It is optional and used only if * no current execution (e.g., in a working thread). * The instance of {@link WebApp} can be retrieved by use of {@link org.zkoss.zk.ui.http.WebManager#getWebApp}, * while the instance of {@link org.zkoss.zk.ui.http.WebManager} can be retrieved * by {@link org.zkoss.zk.ui.http.WebManager#getWebManager} * @param pagedef the page definition to use. It cannot be null. * @param arg a map of parameters that is accessible by the arg variable * in EL, or by {@link Execution#getArg}. * Ignored if null. * @return all top-level components being created. * @see #createComponents(WebApp, String, Map) * @since 3.6.2 */ public static Component[] createComponents(WebApp wapp, PageDefinition pagedef, Map<?, ?> arg) { final CCInfo cci = beforeCC(wapp); try { return cci.exec.createComponents(pagedef, arg); } finally { afterCC(cci); } }
final CCInfo cci = beforeCC(wapp); try { return cci.exec.createComponents(uri, arg); } finally { afterCC(cci);
String.class); if (fulfillURI != null) { cs = merge(cs, ci.exec.createComponents(fulfillURI, parent, insertBefore, null));
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(); }
private static Component[] execCreateChild(CreateInfo ci, Component parent, ComponentInfo childInfo, ReplaceableText replaceableText, Component insertBefore) { final ComponentDefinition childdef = childInfo.getComponentDefinition(); if (childdef.isInlineMacro()) { if (insertBefore != null) throw new UnsupportedOperationException("The inline macro doesn't support template"); final Map<String, Object> props = new HashMap<String, Object>(); props.put("includer", parent); childInfo.evalProperties(props, ci.page, parent, true); return new Component[] { ci.exec.createComponents(childdef.getMacroURI(), parent, props) }; } else { String rt = null; if (replaceableText != null) { // ZK-3549 should ignore blank but was not able to do so in Parser, e.g. applying template if (parent == null || parent.getDefinition().isBlankPreserved()) { rt = replaceableText.text; } replaceableText.text = childInfo.getReplaceableText(); if (replaceableText.text != null) return new Component[0]; //Note: replaceableText is one-shot only //So, replaceable text might not be generated //and it is ok since it is only blank string } Component child = execCreateChild0(ci, parent, childInfo, rt, insertBefore); return child != null ? new Component[] { child } : new Component[0]; } }
"Root element <html> and DOCTYPE are not allowed in included file: [" + _src + "]"); exec.createComponents(pdef, this, _dynams); if (j >= 0) log.warn("Query string is not allowed in instant mode: [" + _src + "]");
return; //don't do twice _inlines = exec.createComponents(_uri != null ? _uri : getDefinition().getMacroURI(), _props); return; //don't do twice (silently) exec.createComponents(_uri != null ? _uri : getDefinition().getMacroURI(), this, _props);
public void onEvent(Event evt) throws Exception { for (int j = _targets.length; --j >= 0;) _targets[j].removeEventListener(_evtnms[j], this); //one shot only final Execution exec = Executions.getCurrent(); execCreate0( new CreateInfo(((WebAppCtrl) exec.getDesktop().getWebApp()).getUiFactory(), exec, _comp.getPage(), null), //technically sys composer can be used but we don't (to simplify it) _compInfo, _comp, null); if (_uri != null) { final String uri = (String) Evaluators.evaluate(_compInfo.getEvaluator(), _comp, _uri, String.class); if (uri != null) exec.createComponents(uri, _comp, null); } Events.sendEvent(new FulfillEvent(Events.ON_FULFILL, _comp, evt)); //Use sendEvent so onFulfill will be processed before //the event triggers the fulfill (i.e., evt) }