/** * Gets the active request cycle for this component * * @return The request cycle */ public final RequestCycle getRequestCycle() { return RequestCycle.get(); }
/** * Convenience method to get the http response. * * @return WebResponse related to the RequestCycle */ private WebResponse getWebResponse() { return (WebResponse)RequestCycle.get().getResponse(); }
/** {@inheritDoc} */ public String rewriteStaticRelativeUrl(String string) { return UrlUtils.rewriteToContextRelative(string, RequestCycle.get().getRequest()); }
@Override protected void respond(AjaxRequestTarget ajaxRequestTarget) { HttpServletRequest r = ((WebRequest) RequestCycle.get().getRequest()).getHttpServletRequest(); if (r.getParameter("finished") != null && r.getParameter("finished").equals("true")) { if (r.getParameter("scrollPosY") != null) { ajaxRequestTarget.appendJavascript("YAHOO.hippo.Upload.restoreScrollPosition(" + r.getParameter( "scrollPosY") + ");"); } onFinish(ajaxRequestTarget); } }
/** * Gets the active request cycle for this component * * @return The request cycle */ public final RequestCycle getRequestCycle() { return RequestCycle.get(); }
/** * Constructor * * @param page */ public AjaxRequestTarget(Page page) { this.page = page; Response response = RequestCycle.get().getResponse(); encodingBodyResponse = new AjaxResponse(response); encodingHeaderResponse = new AjaxResponse(response); }
/** * @see org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest#onUploadStarted(int) */ @Override protected void onUploadStarted(int totalBytes) { UploadInfo info = new UploadInfo(totalBytes); HttpServletRequest request = ((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest(); UploadWebRequest.setUploadInfo(request, info); }
/** * Redirects to the specified bookmarkable page * * @param pageClass * class of bookmarkable page */ public RestartResponseException(Class pageClass) { RequestCycle.get().setResponsePage(pageClass); }
@Override public void close() { // write the stuff that was actually supposed to be in the header to the // response, which is used by the built-in HtmlHeaderContainer to get // its contents CharSequence headerContent = getContent(headerFilterName); RequestCycle.get().getResponse().write(headerContent); // must make sure our super (and with it, the wrapped response) get closed: super.close(); }
/** * @see org.apache.wicket.markup.html.link.ILinkListener#onLinkClicked() */ public final void onLinkClicked() { RequestCycle.get().getRequest().getRequestParameters().setPageMapName(pageMapName); setResponsePage(pageLink.getPage()); }
@Override protected CharSequence getIndicatorUrl() { return RequestCycle.get().urlFor(AJAX_LOADER_GIF); } };
public String getUrl() { String docUrl = "binaries" + path; String url; if (selectedResourceDefinition != null) { url = RichTextUtil.encode(docUrl + "/" + selectedResourceDefinition); } else { url = RichTextUtil.encode(docUrl); } url = RequestCycle.get().getResponse().encodeURL(url).toString(); return RichTextUtil.encodeResourceURL(url); }
protected final void respond(AjaxRequestTarget target) { Request request = RequestCycle.get().getRequest(); String newContent = request.getParameter(PARAM_HTMLCONT); newContent = onSave(target, newContent); Component component = getComponent(); IModel defaultModel = component.getDefaultModel(); defaultModel.setObject(newContent); target.addComponent(component); }
@Override public void onClick() { DownloadRequestTarget requestTarget = createDownloadRequestTarget(); RequestCycle.get().setRequestTarget(requestTarget); }
public void onRequest() { WebRequestCycle wrc = (WebRequestCycle) RequestCycle.get(); wrc.setRequestTarget(new ProxyResponseTarget()); wrc.setRedirect(false); }
@Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("style", "background-image: url('" + RequestCycle.get().urlFor(getMenuIcon(node)) + "')"); } };
@Override protected void onBeforeRender() { super.onBeforeRender(); IRequestTarget target = ((WebRequestCycle)RequestCycle.get()).getRequestTarget(); if(target instanceof AjaxRequestTarget){ //if refreshed by ajax render it again ((AjaxRequestTarget)target).appendJavascript(getInitJs()); } }
@Override public String getObject() { settings.getBackground().add( "background", "url(" + RequestCycle.get().urlFor( settings.getBackgroundResource()) + ") repeat-x"); return settings.getBackground().getStyle(); }
/** * @see org.apache.wicket.behavior.IBehaviorListener#onRequest() */ public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle.get().setRequestTarget(target); respond(target); }
@Override protected String getRightDownStyle() { YuiSliderSettings settings = getSliderSettings(); ImageResourceInfo res = new ImageResourceInfo(settings.getRightDownResource()); CSSInlineStyle background = new CSSInlineStyle(); background.add("background", "url(" + RequestCycle.get().urlFor(settings.getRightDownResource()) + ") no-repeat"); background.add("width", res.getWidth() + "px"); background.add("height", res.getHeight() + "px"); return background.getStyle(); }