Package org.apache.wicket.request.handler

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


   */
  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


          provider.setPageSource(getContext());

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

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

      PageInfo i = new PageInfo(page.getPageId());
      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.getPageId());
      ComponentInfo componentInfo = new ComponentInfo(renderCount,
        requestListenerInterfaceToString(listenerInterface), componentPath,
        handler.getBehaviorIndex());
      info = new PageComponentInfo(pageInfo, componentInfo);
    }

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

    // selection changed?
    if (wantOnSelectionChangedNotifications())
    {
      // we do not want relative URL here, because it will be used by
      // Form#dispatchEvent
      CharSequence url = urlFor(new ListenerInterfaceRequestHandler(
        new PageAndComponentProvider(getPage(), this), IOnChangeListener.INTERFACE));

      Form<?> form = findParent(Form.class);
      if (form != null)
      {
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

  private String urlForBehavior(IBehavior behaviorUnderTest)
  {
    int index = page.container.getBehaviorId(behaviorUnderTest);
    String enabledBehaviorUrl = tester.urlFor(
      new ListenerInterfaceRequestHandler(new PageAndComponentProvider(page, page.container),
        IBehaviorListener.INTERFACE, index)).toString();
    return enabledBehaviorUrl;
  }
View Full Code Here

    Url url = Url.parse("some/mount/path?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("some/mount/path/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("some/mount/path?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

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.