/** * This constructor is ideal if a Page object was passed in from a previous Page. Construct an * inline frame containing the given Page. * * @param id * See component * @param page * The page */ public InlineFrame(final String id, final Page page) { this(id, page.getPageMap(), new IPageLink() { private static final long serialVersionUID = 1L; public Page getPage() { // use given page return page; } public Class<? extends Page> getPageIdentity() { return page.getClass(); } }); }
/** * This constructor is ideal if a Page object was passed in from a previous Page. Construct an * inline frame containing the given Page. * * @param id * See component * @param page * The page */ public InlineFrame(final String id, final Page page) { this(id, page.getPageMap(), new IPageLink() { private static final long serialVersionUID = 1L; public Page getPage() { // use given page return page; } public Class getPageIdentity() { return page.getClass(); } }); }
/** * Redirects to any intercept page previously specified by a call to redirectToInterceptPage. * * @return True if an original destination was redirected to * @see Component#redirectToInterceptPage(Page) */ public final boolean continueToOriginalDestination() { return getPage().getPageMap().continueToOriginalDestination(); }
/** * Redirects to any intercept page previously specified by a call to redirectToInterceptPage. * * @return True if an original destination was redirected to * @see Component#redirectToInterceptPage(Page) */ public final boolean continueToOriginalDestination() { return getPage().getPageMap().continueToOriginalDestination(); }
/** * @return Page map for this link */ public final IPageMap getPageMap() { if (pageMapName != null) { return PageMap.forName(pageMapName); } else { return getPage().getPageMap(); } }
/** * @return Page map for this link */ public final IPageMap getPageMap() { if (pageMapName != null) { return PageMap.forName(pageMapName); } else { return getPage().getPageMap(); } }
/** * Redirects browser to an intermediate page such as a sign-in page. The current request's url * is saved for future use by method continueToOriginalDestination(); Only use this method when * you plan to continue to the current url at some later time; otherwise just use * setResponsePage or - when you are in a constructor or checkAccessMethod, call redirectTo. * * @param page * The sign in page * * @see Component#continueToOriginalDestination() */ public final void redirectToInterceptPage(final Page page) { getPage().getPageMap().redirectToInterceptPage(page); }
/** * Redirects browser to an intermediate page such as a sign-in page. The current request's url * is saved for future use by method continueToOriginalDestination(); Only use this method when * you plan to continue to the current url at some later time; otherwise just use * setResponsePage or - when you are in a constructor or checkAccessMethod, call redirectTo. * * @param page * The sign in page * * @see Component#continueToOriginalDestination() */ public final void redirectToInterceptPage(final Page page) { getPage().getPageMap().redirectToInterceptPage(page); }
/** * @see org.apache.wicket.markup.html.link.Link#onClick() */ @Override public void onClick() { // Remove the popup's page map from the session getPage().getPageMap().remove(); // Web page closes window using javascript code in PopupCloseLink$1.html setResponsePage(ClosePopupPage.class); } }
/** * @see org.apache.wicket.markup.html.link.Link#onClick() */ public void onClick() { // Remove the popup's page map from the session getPage().getPageMap().remove(); // Web page closes window using javascript code in PopupCloseLink$1.html setResponsePage(ClosePopupPage.class); } }
/** * Redirects to intercept page using the page map for the current request * * @param interceptPage * The intercept page to redirect to */ private void redirectToInterceptPage(final Page interceptPage) { final Page requestPage = RequestCycle.get().getRequest().getPage(); /* * requestPage can be null if we throw the restart response exception before any page is * instantiated in user's session. if this happens we switch to the pagemap of the * interceptPage */ final IPageMap pageMap; if (requestPage != null) { pageMap = requestPage.getPageMap(); } else { pageMap = interceptPage.getPageMap(); } pageMap.redirectToInterceptPage(interceptPage); }
/** * Returns a bookmarkable URL that references a given page class using a given set of page * parameters. Since the URL which is returned contains all information necessary to instantiate * and render the page, it can be stored in a user's browser as a stable bookmark. * * @see RequestCycle#urlFor(IPageMap, Class, PageParameters) * * @param pageClass * Class of page * @param parameters * Parameters to page * @return Bookmarkable URL to page */ public final CharSequence urlFor(final Class pageClass, final PageParameters parameters) { return getRequestCycle().urlFor(getPage().getPageMap(), pageClass, parameters); }
/** * Returns a bookmarkable URL that references a given page class using a given set of page * parameters. Since the URL which is returned contains all information necessary to instantiate * and render the page, it can be stored in a user's browser as a stable bookmark. * * @param <C> * * @see RequestCycle#urlFor(IPageMap, Class, PageParameters) * * @param pageClass * Class of page * @param parameters * Parameters to page * @return Bookmarkable URL to page */ public final <C extends Page> CharSequence urlFor(final Class<C> pageClass, final PageParameters parameters) { return getRequestCycle().urlFor(getPage().getPageMap(), pageClass, parameters); }
@Override protected void onBeforeRender() { super.onBeforeRender(); if (uploadIFrame == null) { // the iframe should be attached to a page to be able to get its pagemap, // that's why i'm adding it in onBeforeRender IPageLink iFrameLink = new IPageLink() { public Page getPage() { return new UploadIFrame(parentField.getFieldValueModel()) { protected String getOnUploadedCallback() { return "onUpload_" + UploadPanel.this.getMarkupId(); } protected LifeCycleListener getLifeCycleListener() { return (AbstractOntopolyPage)UploadPanel.this.getPage(); } }; } public Class<? extends Page> getPageIdentity() { return UploadIFrame.class; } }; uploadIFrame = new InlineFrame("upload", getPage().getPageMap(), iFrameLink); add(uploadIFrame); } }
private void setNextAvailableId() { if (getApplication().getSessionSettings().isPageIdUniquePerSession()) { setNumericId(getSession().nextPageId()); } else { // Set the numeric id on this page setNumericId(getPageMap().nextId()); } }
/** * */ private void setNextAvailableId() { if (getApplication().getSessionSettings().isPageIdUniquePerSession()) { setNumericId(getSession().nextPageId()); } else { // Set the numeric id on this page setNumericId(getPageMap().nextId()); } }
@Override protected PageParameters getLinkPageParameters() { PageParameters params = new PageParameters(); params.put("pageMap", getPage().getPageMap().getName()); params.put("pageId", getPage().getId()); params.put("version", getPage().getVersions()-1); return params; }
/** * Redirects to intercept page using the page map for the current request * * @param interceptPageClass * The intercept page class to redirect to */ private void redirectToInterceptPage(final Class interceptPageClass) { final RequestCycle cycle = RequestCycle.get(); final Page requestPage = cycle.getRequest().getPage(); /* * requestPage can be null if we throw the restart response exception before any page is * instantiated in user's session. if this happens we switch to the pagemap of the request. */ final IPageMap pageMap; if (requestPage != null) { pageMap = requestPage.getPageMap(); } else { RequestParameters parameters = cycle.getRequest().getRequestParameters(); pageMap = PageMap.forName(parameters.getPageMapName()); } pageMap.redirectToInterceptPage(interceptPageClass); } }
/** * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR OVERRIDE. * */ private final void endVersion() { // Any changes to the page after this point will be tracked by the // page's version manager. Since trackChanges is never set to false, // this effectively means that change tracking begins after the // first request to a page completes. setFlag(FLAG_TRACK_CHANGES, true); // If a new version was created if (getFlag(FLAG_NEW_VERSION)) { // Reset boolean for next request setFlag(FLAG_NEW_VERSION, false); // We're done with this version if (versionManager != null) { versionManager.endVersion(getRequest().mergeVersion()); } // Evict any page version(s) as need be getApplication().getSessionSettings().getPageMapEvictionStrategy().evict(getPageMap()); } }
/** * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR OVERRIDE. * */ private final void endVersion() { // Any changes to the page after this point will be tracked by the // page's version manager. Since trackChanges is never set to false, // this effectively means that change tracking begins after the // first request to a page completes. setFlag(FLAG_TRACK_CHANGES, true); // If a new version was created if (getFlag(FLAG_NEW_VERSION)) { // Reset boolean for next request setFlag(FLAG_NEW_VERSION, false); // We're done with this version if (versionManager != null) { versionManager.endVersion(getRequest().mergeVersion()); } // Evict any page version(s) as need be getApplication().getSessionSettings().getPageMapEvictionStrategy().evict(getPageMap()); } }