Package org.apache.wicket.request.handler

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


    Url url = Url.parse("wicket/bookmarkable/" + 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("wicket/bookmarkable/" + 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.getIndexedParamsCount());
    assertEquals("i1", p.getIndexedParameter(0).toString());
    assertEquals("i2", p.getIndexedParameter(1).toString());
View Full Code Here

      "?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

          provider.setPageSource(getContext());

          // listener interface
          RequestListenerInterface listenerInterface = requestListenerInterfaceFromString(componentInfo.getListenerInterface());

          return new ListenerInterfaceRequestHandler(provider, listenerInterface,
            componentInfo.getBehaviorIndex());
        }
      }
    }
    return null;
View Full Code Here

      PageInfo i = new PageInfo(page);
      info = new PageComponentInfo(i, null);
    }
    else if (requestHandler instanceof ListenerInterfaceRequestHandler)
    {
      ListenerInterfaceRequestHandler handler = (ListenerInterfaceRequestHandler)requestHandler;
      IRequestablePage page = handler.getPage();
      String componentPath = handler.getComponent().getPageRelativePath();
      RequestListenerInterface listenerInterface = handler.getListenerInterface();

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

      PageInfo pageInfo = new PageInfo(page);
      ComponentInfo componentInfo = new ComponentInfo(renderCount,
        requestListenerInterfaceToString(listenerInterface), componentPath,
        handler.getBehaviorIndex());
      info = new PageComponentInfo(pageInfo, componentInfo);
    }

    if (info != null)
    {
View Full Code Here

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

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

   */
  public void executeListener(Component component, RequestListenerInterface listener)
  {
    // there are two ways to do this. RequestCycle could be forced to call the handler
    // directly but constructing and parsing the URL increases the chance of triggering bugs
    IRequestHandler handler = new ListenerInterfaceRequestHandler(new PageAndComponentProvider(
      component.getPage(), component), listener);

    Url url = urlFor(handler);
    MockHttpServletRequest request = new MockHttpServletRequest(application, hsession,
      servletContext);
View Full Code Here

      PageAndComponentProvider provider = new PageAndComponentProvider(pageInfo.getPageId(),
        pageClass, pageParameters, renderCount, componentInfo.getComponentPath());

      provider.setPageSource(getContext());

      return new ListenerInterfaceRequestHandler(provider, listenerInterface,
        componentInfo.getBehaviorId());
    }
    else
    {
      if (logger.isWarnEnabled())
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.