Package org.apache.wicket.request.handler

Examples of org.apache.wicket.request.handler.ListenerInterfaceRequestHandler


    Url url = Url.parse(PAGE_CLASS_NAME + "?15-ILinkListener-foo-bar");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);

    ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;

    IRequestablePage page = h.getPage();
    checkPage(page, 15);

    assertEquals(ILinkListener.INTERFACE, h.getListenerInterface());
    assertEquals("foo:bar", h.getComponent().getPageRelativePath());
    assertNull(h.getBehaviorIndex());
  }
View Full Code Here


  {
    Url url = Url.parse(PAGE_CLASS_NAME + "/i1/i2?15-ILinkListener-foo-bar&a=b&b=c");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);
    ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;

    IRequestablePage page = h.getPage();
    checkPage(page, 15);

    assertEquals(ILinkListener.INTERFACE, h.getListenerInterface());
    assertEquals("foo:bar", h.getComponent().getPageRelativePath());

    PageParameters p = page.getPageParameters();
    assertEquals(2, p.getIndexedCount());
    assertEquals("i1", p.get(0).toString());
    assertEquals("i2", p.get(1).toString());
View Full Code Here

    Url url = Url.parse(PAGE_CLASS_NAME + "?15-ILinkListener.4-foo-bar");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);

    ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;

    IRequestablePage page = h.getPage();
    checkPage(page, 15);

    assertEquals(ILinkListener.INTERFACE, h.getListenerInterface());
    assertEquals("foo:bar", h.getComponent().getPageRelativePath());
    assertEquals((Object)4, h.getBehaviorIndex());
  }
View Full Code Here

    context.setNextPageRenderCount(5);

    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);
    ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;

    IRequestablePage page = h.getPage();
    assertEquals(page.getRenderCount(), 5);
  }
View Full Code Here

  private String urlForBehavior(Behavior behaviorUnderTest)
  {
    final int index = page.container.getBehaviorId(behaviorUnderTest);
    final IPageAndComponentProvider provider = new PageAndComponentProvider(page,
      page.container);
    final IRequestHandler handler = new ListenerInterfaceRequestHandler(provider,
      IBehaviorListener.INTERFACE, index);

    return tester.urlFor(handler).toString();
  }
View Full Code Here

    Url url = super.mapHandler(requestHandler);

    if (url == null && requestHandler instanceof ListenerInterfaceRequestHandler &&
      getRecreateMountedPagesAfterExpiry())
    {
      ListenerInterfaceRequestHandler handler = (ListenerInterfaceRequestHandler)requestHandler;
      IRequestablePage page = handler.getPage();
      if (checkPageInstance(page))
      {
        String componentPath = handler.getComponentPath();
        RequestListenerInterface listenerInterface = handler.getListenerInterface();

        Integer renderCount = null;
        if (listenerInterface.isIncludeRenderCount())
        {
          renderCount = page.getRenderCount();
        }

        PageInfo pageInfo = getPageInfo(handler);
        ComponentInfo componentInfo = new ComponentInfo(renderCount,
          requestListenerInterfaceToString(listenerInterface), componentPath,
          handler.getBehaviorIndex());
        PageComponentInfo pageComponentInfo = new PageComponentInfo(pageInfo, componentInfo);
        PageParameters parameters = new PageParameters(page.getPageParameters());
        UrlInfo urlInfo = new UrlInfo(pageComponentInfo, page.getClass(),
          parameters.mergeWith(handler.getPageParameters()));
        url = buildUrl(urlInfo);
      }
    }

    return url;
View Full Code Here

    @Override
    public void onComponentTag(Component component, ComponentTag tag)
    {
      super.onComponentTag(component, tag);
      int index = component.getBehaviorId(this);
      IRequestHandler handler = new ListenerInterfaceRequestHandler(
        new PageAndComponentProvider(component.getPage(), component),
        IBehaviorListener.INTERFACE, index);
      statefullUrl = component.getRequestCycle().mapUrlFor(handler).toString();
    }
View Full Code Here

  private String urlForBehavior(Behavior behaviorUnderTest)
  {
    final int index = page.container.getBehaviorId(behaviorUnderTest);
    final IPageAndComponentProvider provider = new PageAndComponentProvider(page,
      page.container);
    final IRequestHandler handler = new ListenerInterfaceRequestHandler(provider,
      IBehaviorListener.INTERFACE, index);

    return tester.urlFor(handler).toString();
  }
View Full Code Here

    {
      handler = new BookmarkableListenerInterfaceRequestHandler(provider, listener, id);
    }
    else
    {
      handler = new ListenerInterfaceRequestHandler(provider, listener, id);
    }
    return getRequestCycle().urlFor(handler);
  }
View Full Code Here

    {
      handler = new BookmarkableListenerInterfaceRequestHandler(provider, listener);
    }
    else
    {
      handler = new ListenerInterfaceRequestHandler(provider, listener);
    }
    return getRequestCycle().urlFor(handler);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.handler.ListenerInterfaceRequestHandler

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.