/** * Creates a new ajax request target from the given Page. * * @param application * the web application * @param page * page on which ajax response is made * @return an AjaxRequestTarget instance * * @see WebApplication#newAjaxRequestTarget(Page) * */ @SuppressWarnings("javadoc") public static AjaxRequestTarget newAjaxRequestTarget(final WebApplication application, final Page page) { return application.newAjaxRequestTarget(page); } }
@Override public void respond(IRequestCycle requestCycle) { Page page = (Page)Application.get().getMapperContext().getPageInstance(pageKey.getPageId()); AjaxRequestTarget target = WebApplication.get().newAjaxRequestTarget(page); executeHandlers(target, page); }
@Override public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle requestCycle = RequestCycle.get(); requestCycle.scheduleRequestHandlerAfterCurrent(target); respond(target); }
@Override public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle requestCycle = RequestCycle.get(); requestCycle.scheduleRequestHandlerAfterCurrent(target); respond(target); }
/** * @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); }
/** * @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 public void respond(IRequestCycle requestCycle) { WebApplication application = WebApplication.get(); Integer pageId = pageKey.getPageId(); Page page = (Page) Session.get().getPageManager().getPage(pageId); if (page != null) { page.dirty(); AjaxRequestTarget target = application.newAjaxRequestTarget(page); executeHandlers(target, page); } else { LOGGER.warn("Could not find a page with id '{}' for session with id '{}' in the page stores. It will be unregistered", pageId, pageKey.getSessionId()); EventBus.get(application).unregister(pageKey); } }
@Override public void respond(Attributes attributes) { try { PageParameters parameters = attributes.getParameters(); int pageId = parameters.get("pageId").toInt(); Page page = (Page)WebSession.get().getPageManager().getPage(pageId); AjaxRequestTarget newAjaxRequestTarget = ((WebApplication)Application.get()).newAjaxRequestTarget(page); RequestCycle.get().scheduleRequestHandlerAfterCurrent(newAjaxRequestTarget); page.send(page, Broadcast.BREADTH, new JEEWebGlobalAjaxEvent( newAjaxRequestTarget, parameters, RequestCycle.get() .getRequest() .getPostParameters())); } catch (Exception e) { LOGGER.error("Error while processing the ajax request", e); } } };
AjaxRequestTarget target = getApplication().newAjaxRequestTarget(link.getPage()); requestCycle.setRequestTarget(target); AjaxRequestTarget target = getApplication().newAjaxRequestTarget(link.getPage()); requestCycle.setRequestTarget(target);