Package org.apache.wicket

Examples of org.apache.wicket.Page$IPageSerializer


     */
    public void testDefaults()
    {
        WicketTester tester = new WicketTester();
        tester.startPage(BeanMetaDataTestNoPropsPage.class);
        Page page = tester.getLastRenderedPage();
       
        BeanMetaDataTestBean bean = new BeanMetaDataTestBean();
        BeanMetaData beanMetaData = new BeanMetaData(BeanMetaDataTestBean.class, null, page, null, false);
        // Check parameters, elements, element parameters, tabs, tab elements.
        assertFalse( beanMetaData.isViewOnly() );
View Full Code Here


     */
    public void testContext()
    {
        WicketTester tester = new WicketTester();
        tester.startPage(BeanMetaDataTestPage.class);
        Page page = tester.getLastRenderedPage();
       
        BeanMetaDataTestBean bean = new BeanMetaDataTestBean();
        // Use the "view" context
        BeanMetaData beanMetaData = new BeanMetaData(BeanMetaDataTestBean.class, "view", page, null, false);
        // Check parameters, elements, element parameters, tabs, tab elements.
View Full Code Here

     */
    public void testContextWithExtends()
    {
        WicketTester tester = new WicketTester();
        tester.startPage(BeanMetaDataTestPage.class);
        Page page = tester.getLastRenderedPage();
       
        BeanMetaDataTestBean bean = new BeanMetaDataTestBean();
        // Use the "popupView" context
        BeanMetaData beanMetaData = new BeanMetaData(BeanMetaDataTestBean.class, "popupView", page, null, false);
        // Check parameters, elements, element parameters, tabs, tab elements.
View Full Code Here

     */
    public void testMissingContext()
    {
        WicketTester tester = new WicketTester();
        tester.startPage(BeanMetaDataTestPage.class);
        Page page = tester.getLastRenderedPage();
       
        BeanMetaDataTestBean bean = new BeanMetaDataTestBean();
        try {
            BeanMetaData beanMetaData = new BeanMetaData(BeanMetaDataTestBean.class, "missingContext", page, null, false);
            fail("Expected exception on missing context");
View Full Code Here

  @Override
  public void onBeforeRender(Component component)
  {
    if (component instanceof Page)
    {
      Page page = (Page)component;
      IRequestHandler activeRequestHandler = page.getRequestCycle().getActiveRequestHandler();
      autoEndIfNecessary(page, activeRequestHandler);
      autoBeginIfNecessary(page, activeRequestHandler);
    }
  }
View Full Code Here

        linkClicked = true;
        ajaxRequestTarget = target;
      }
    };

    Page page = new MockPageWithLink();
    page.add(ajaxLink);
    tester.startPage(page);
    tester.clickLink("ajaxLink");

    assertTrue(linkClicked);
    assertNotNull(ajaxRequestTarget);
View Full Code Here

   * AjaxRequestTarget is not null.
   */
  @Test
  public void testAjaxFallbackLinkClick()
  {
    final Page page = new MockPageWithLink();

    // Create a link, which we test is actually invoked
    page.add(new AjaxFallbackLink<Void>("ajaxLink")
    {
      private static final long serialVersionUID = 1L;

      @Override
      public void onClick(AjaxRequestTarget target)
View Full Code Here

   * AjaxRequestTarget.
   */
  @Test
  public void testFallbackLinkWithAjaxDisabled()
  {
    final Page page = new MockPageWithLink();

    // Create a link, which we test is actually invoked
    page.add(new AjaxFallbackLink<Void>("ajaxLink")
    {
      private static final long serialVersionUID = 1L;

      @Override
      public void onClick(AjaxRequestTarget target)
View Full Code Here

   */
  public static boolean isMarkupHtml5Compliant(final MarkupContainer container)
  {
    Args.notNull(container, "container");

    Page page = container.getPage();
    if (page == null)
    {
      throw new WicketRuntimeException("Component not attached to Page. Component: " +
        container.toString());
    }


    final boolean rtn[] = new boolean[] { true };
    page.visitChildren(MarkupContainer.class, new IVisitor<MarkupContainer, Void>()
    {
      @Override
      public void component(final MarkupContainer comp, final IVisit<Void> visit)
      {
        IMarkupFragment associatedMarkup = comp.getAssociatedMarkup();
View Full Code Here

   * @throws Exception
   */
  @Test
  public void panel() throws Exception
  {
    Page page = new MyPage();
    Panel panel = new MyPanel("panel");
    page.add(panel);

    // Get the associated markup file
    IMarkupFragment markup = panel.getAssociatedMarkup();
    compareMarkupWithFile(markup, "MyPanel_ExpectedResult.html");

    // The Page is missing the tag to "call" the panel
    assertNull(panel.getMarkup());

    // Create a Page with proper markup for the panel
    page = new MyPanelPage();
    panel = (Panel)page.get("panel");

    // getMarkup() returns the "calling" tags
    markup = panel.getMarkup();
    compareMarkupWithString(markup, "<span wicket:id=\"panel\">test</span>");

View Full Code Here

TOP

Related Classes of org.apache.wicket.Page$IPageSerializer

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.