Package org.apache.wicket

Examples of org.apache.wicket.Page


  @Test
  public void test1() throws Exception
  {
    // How does the test work: Make sure you have a page, form and form component properly set
    // up (getRelativePath() etc.). See #before().
    final Page page = tester.getLastRenderedPage();

    // Get the form and form component created
    final TestForm form = (TestForm)page.get("form");
    final TextField<String> textField = (TextField<String>)form.get("input");

    // Right after init, the requests and responses cookie lists must be empty
    assertEquals(0, getRequestCookies().size());
    assertEquals(0, getResponseCookies().size());
View Full Code Here


  /**
   * Test
   */
  public void test()
  {
    final Page dummyPanelPage = new DummyPanelPage(new ITestPanelSource()
    {
      private static final long serialVersionUID = 1L;

      public Panel getTestPanel(final String panelId)
      {
View Full Code Here

      appendAssignment(buffer, "settings.heightUnit", getHeightUnit());
    }

    if (isCustomComponent() == false)
    {
      Page page = createPage();
      if (page == null)
      {
        throw new WicketRuntimeException("Error creating page for modal dialog.");
      }
View Full Code Here

   *            expected class of last rendered page
   * @return a <code>Result</code>
   */
  public <C extends Page> Result isRenderedPage(Class<C> expectedRenderedPageClass)
  {
    Page page = getLastRenderedPage();
    if (page == null)
    {
      return Result.fail("page was null");
    }
    if (!page.getClass().isAssignableFrom(expectedRenderedPageClass))
    {
      return isEqual(Classes.simpleName(expectedRenderedPageClass),
        Classes.simpleName(page.getClass()));
    }
    return Result.pass();
  }
View Full Code Here

   *      component in the default manner
   */
  public void process(IFormSubmittingComponent submittingComponent)
  {
    // save the page in case the component is removed during submit
    final Page page = getPage();

    // process the form for this request
    if (process())
    {
      // let clients handle further processing
      delegateSubmit(submittingComponent);
    }

    // WICKET-1912
    // If the form is stateless page parameters contain all form component
    // values. We need to remove those otherwise they get appended to action URL
    final PageParameters parameters = page.getPageParameters();
    if (parameters != null)
    {
      visitFormComponents(new FormComponent.IVisitor()
      {
        public Object formComponent(IFormVisitorParticipant formComponent)
View Full Code Here

   */
  public void testFromAjaxRequestToNormalPage()
  {
    tester.startPage(AjaxLinkPageToNormalPage.class);
    tester.assertRenderedPage(AjaxLinkPageToNormalPage.class);
    Page page = tester.getLastRenderedPage();
    Component ajaxLink = page.get("ajaxLink");
    AbstractAjaxBehavior behavior = (AbstractAjaxBehavior)ajaxLink.getBehaviors().get(0);
    tester.executeBehavior(behavior);
    tester.assertRenderedPage(NormalPage.class);
  }
View Full Code Here

   */
  public void testPage_2() throws Exception
  {
    executeTest(AjaxPage2.class, "AjaxPage2_ExpectedResult.html");

    Page page = tester.getLastRenderedPage();
    Component ajaxLink = page.get("pageLayout:pageLayout_body:ajaxLink");
    AbstractAjaxBehavior behavior = (AbstractAjaxBehavior)ajaxLink.getBehaviors().get(0);

    executeBehavior(behavior, "AjaxPage2-1_ExpectedResult.html");
  }
View Full Code Here

   */
  public void testRenderHomePage_2() throws Exception
  {
    executeTest(AjaxLinkWithBorderPage.class, "AjaxLinkWithBorderPageExpectedResult.html");

    Page page = tester.getLastRenderedPage();
    Component ajaxLink = page.get("border:border_body:ajaxLink");
    AbstractAjaxBehavior behavior = (AbstractAjaxBehavior)ajaxLink.getBehaviors().get(0);

    executeBehavior(behavior, "AjaxLinkWithBorderPage-1ExpectedResult.html");
  }
View Full Code Here

   * @return A BookmarkablePageLink<?> to handle the href
   */
  private final Component resolveAutomaticLink(final MarkupContainer container, final String id,
    final ComponentTag tag)
  {
    final Page page = container.getPage();

    // Make the id (page-)unique
    final String autoId = id + Integer.toString(page.getAutoIndex());

    // get the tag name, which is something like 'a' or 'script'
    final String tagName = tag.getName();

    // By setting the component name, the tag becomes a Wicket component
View Full Code Here

      {
        // Obviously a href like href="myPkg.MyLabel.html" will do as
        // well. Wicket will not throw an exception. It accepts it.


        Page page = container.getPage();
        final IClassResolver defaultClassResolver = page.getApplication()
          .getApplicationSettings()
          .getClassResolver();
        String className = Packages.absolutePath(page.getClass(), pathInfo.path);
        className = Strings.replaceAll(className, "/", ".").toString();
        if (className.startsWith("."))
        {
          className = className.substring(1);
        }

        try
        {
          final Class<? extends Page> clazz = (Class<? extends Page>)defaultClassResolver.resolveClass(className);
          return new AutolinkBookmarkablePageLink<Void>(autoId, clazz,
            pathInfo.pageParameters, pathInfo.anchor);
        }
        catch (ClassNotFoundException ex)
        {
          log.warn("Did not find corresponding java class: " + className);
          // fall through
        }

        // Make sure base markup pages (inheritance) are handled correct
        MarkupContainer parentWithContainer = container;
        if (container.getParent() != null)
        {
          parentWithContainer = container.findParentWithAssociatedMarkup();
        }
        if ((parentWithContainer instanceof Page) && !pathInfo.path.startsWith("/") &&
          new MarkupStream(page.getMarkup()).isMergedMarkup())
        {
          Class<? extends Page> clazz = (Class<? extends Page>)new MarkupStream(
            container.getMarkup()).getTag().getMarkupClass();
          if (clazz != null)
          {
View Full Code Here

TOP

Related Classes of org.apache.wicket.Page

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.