/** * Gets the previously stored {@link org.apache.tapestry.PageRenderSupport} object. * * @param cycle * the request cycle storing the support object * @param component * the component which requires the support (used to report exceptions) * @throws ApplicationRuntimeException * if no support object has been stored */ public static PageRenderSupport getPageRenderSupport(IRequestCycle cycle, IComponent component) { Defense.notNull(component, "component"); PageRenderSupport result = getOptionalPageRenderSupport(cycle); if (result == null) throw new ApplicationRuntimeException(TapestryMessages.noPageRenderSupport(component), component.getLocation(), null); return result; }
/** * {@inheritDoc} */ public void renderComponent(IRequestCycle cycle, IComponent component) { if (cycle.isRewinding()) return; if (Component.class.isInstance(component) && !((Component)component).hasEvents() && !IForm.class.isInstance(component)) return; if (TapestryUtils.getOptionalPageRenderSupport(cycle) == null) return; // Don't render fields being pre-rendered, otherwise we'll render twice IComponent field = (IComponent)cycle.getAttribute(TapestryUtils.FIELD_PRERENDER); if (field != null && field == component) return; linkComponentEvents(cycle, component); linkElementEvents(cycle, component); if (IForm.class.isInstance(component)) mapFormNames(cycle, (IForm)component); if (isDeferredForm(component)) linkDeferredForm(cycle, (IForm)component); }
/** * Gets the previously stored {@link org.apache.tapestry.PageRenderSupport} object. * * @param cycle * the request cycle storing the support object * @param component * the component which requires the support (used to report exceptions) * @throws ApplicationRuntimeException * if no support object has been stored */ public static PageRenderSupport getPageRenderSupport(IRequestCycle cycle, IComponent component) { Defense.notNull(component, "component"); PageRenderSupport result = getOptionalPageRenderSupport(cycle); if (result == null) throw new ApplicationRuntimeException(TapestryMessages.noPageRenderSupport(component), component.getLocation(), null); return result; }
/** * {@inheritDoc} */ public void renderComponent(IRequestCycle cycle, IComponent component) { if (cycle.isRewinding()) return; if (Component.class.isInstance(component) && !((Component)component).hasEvents() && !IForm.class.isInstance(component)) return; if (TapestryUtils.getOptionalPageRenderSupport(cycle) == null) return; // Don't render fields being pre-rendered, otherwise we'll render twice IComponent field = (IComponent)cycle.getAttribute(TapestryUtils.FIELD_PRERENDER); if (field != null && field == component) return; linkComponentEvents(cycle, component); linkElementEvents(cycle, component); if (IForm.class.isInstance(component)) mapFormNames(cycle, (IForm)component); if (isDeferredForm(component)) linkDeferredForm(cycle, (IForm)component); }
public FormSupportImpl(IMarkupWriter writer, IRequestCycle cycle, IForm form, JavascriptManager javascriptManager) { Defense.notNull(writer, "writer"); Defense.notNull(cycle, "cycle"); Defense.notNull(form, "form"); _writer = writer; _cycle = cycle; _form = form; _delegate = form.getDelegate(); _rewinding = cycle.isRewound(form); _allocatedIdIndex = 0; _pageRenderSupport = TapestryUtils.getOptionalPageRenderSupport(cycle); _profile = new JSONObject(); _javascriptManager = javascriptManager; }
public FormSupportImpl(IMarkupWriter writer, IRequestCycle cycle, IForm form, JavascriptManager javascriptManager) { Defense.notNull(writer, "writer"); Defense.notNull(cycle, "cycle"); Defense.notNull(form, "form"); _writer = writer; _cycle = cycle; _form = form; _delegate = form.getDelegate(); _rewinding = cycle.isRewound(form); _allocatedIdIndex = 0; _pageRenderSupport = TapestryUtils.getOptionalPageRenderSupport(cycle); _profile = new JSONObject(); _javascriptManager = javascriptManager; }