Package org.apache.wicket.request.handler

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


  }

  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


   */
  public void executeListener(final Component component, final 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

   * @return The URL
   */
  public final CharSequence urlFor(final Behavior behaviour,
    final RequestListenerInterface listener)
  {
    PageAndComponentProvider provider = new PageAndComponentProvider(getPage(), this);
    int id = getBehaviorId(behaviour);
    IRequestHandler handler;
    if (getPage().isPageStateless())
    {
      handler = new BookmarkableListenerInterfaceRequestHandler(provider, listener, id);
View Full Code Here

   *            The listener interface that the URL should call
   * @return The URL
   */
  public final CharSequence urlFor(final RequestListenerInterface listener)
  {
    PageAndComponentProvider provider = new PageAndComponentProvider(getPage(), this);
    IRequestHandler handler;
    if (getPage().isPageStateless())
    {
      handler = new BookmarkableListenerInterfaceRequestHandler(provider, listener);
    }
View Full Code Here

      listenerInterface = requestListenerInterfaceFromString(componentInfo.getListenerInterface());
    }

    if (listenerInterface != null)
    {
      PageAndComponentProvider provider = new PageAndComponentProvider(pageInfo.getPageId(),
        pageClass, pageParameters, renderCount, componentInfo.getComponentPath());

      provider.setPageSource(getContext());

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

    // as this explicitely says the url must be bookmarkable
    page.setCreatedBookmarkable(false);

    IRequestableComponent c = page.get("foo:bar");

    PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
    IRequestHandler handler = new BookmarkableListenerInterfaceRequestHandler(provider,
      ILinkListener.INTERFACE);

    Url url = encoder.mapHandler(handler);
View Full Code Here

    // as this explicitely says the url must be bookmarkable
    page.setCreatedBookmarkable(false);

    IRequestableComponent c = page.get("foo:bar");

    PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
    IRequestHandler handler = new BookmarkableListenerInterfaceRequestHandler(provider,
      ILinkListener.INTERFACE, 4);

    Url url = encoder.mapHandler(handler);
View Full Code Here

    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

       */
      @Override
      protected String getOnClickScript(CharSequence url)
      {
        IRequestHandler handler = new ListenerInterfaceRequestHandler(
          new PageAndComponentProvider(getPage(), this), ILinkListener.INTERFACE);
        Url componentUrl = RequestCycle.get().mapUrlFor(handler);
        componentUrl.addQueryParameter("anticache", Math.random());
        return new AppendingStringBuffer("new Ajax.Updater('counter', '").append(
          componentUrl)
          .append("', {method:'get'}); return false;")
View Full Code Here

  public final CharSequence urlFor(final Behavior behaviour,
    final RequestListenerInterface listener, final PageParameters parameters)
  {
    int id = getBehaviorId(behaviour);
    Page page = getPage();
    PageAndComponentProvider provider = new PageAndComponentProvider(page, this, parameters);
    IRequestHandler handler;
    if (page.isPageStateless())
    {
      handler = new BookmarkableListenerInterfaceRequestHandler(provider, listener, id);
    }
View Full Code Here

TOP

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

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.