Package org.apache.wicket

Examples of org.apache.wicket.PageParameters


        "Unable to load Bookmarkable Page");
    }

    try
    {
      PageParameters params = new PageParameters(requestParameters.getParameters());
      if (requestParameters.getComponentPath() != null &&
        requestParameters.getInterfaceName() != null)
      {
        final String componentPath = requestParameters.getComponentPath();
        final Page page = session.getPage(requestParameters.getPageMapName(),
View Full Code Here


    try
    {
      // Get the home page class
      Class<? extends Page> homePageClass = application.getHomePage();

      PageParameters parameters = new PageParameters(requestParameters.getParameters());
      // and create a dummy target for looking up whether the home page is
      // mounted
      BookmarkablePageRequestTarget homepageTarget = new BookmarkablePageRequestTarget(
        homePageClass, parameters);
      IRequestCodingStrategy requestCodingStrategy = requestCycle.getProcessor()
View Full Code Here

  /** {@inheritDoc} */
  @Override
  protected ValueMap decodeParameters(String urlFragment, Map urlParameters)
  {
    PageParameters params = new PageParameters();
    // Add all url parameters
    params.putAll(urlParameters);
    String urlPath = urlFragment;
    if (urlPath.startsWith("/"))
    {
      urlPath = urlPath.substring(1);
    }

    if (urlPath.length() > 0)
    {
      String[] pathParts = urlPath.split("/");
      if (pathParts.length > parameterNames.length)
      {
        throw new IllegalArgumentException(
          "Too many path parts, please provide sufficient number of path parameter names");
      }

      for (int i = 0; i < pathParts.length; i++)
      {
        params.put(parameterNames[i], urlDecodePathComponent(pathParts[i]));
      }
    }

    return params;
  }
View Full Code Here

        {
          // create a new request cycle for the newPage call
          createRequestCycle();
          IBookmarkablePageRequestTarget pageClassRequestTarget = (IBookmarkablePageRequestTarget)target;
          Class<? extends Page> pageClass = pageClassRequestTarget.getPageClass();
          PageParameters parameters = pageClassRequestTarget.getPageParameters();
          if (parameters == null || parameters.size() == 0)
          {
            newLastRenderedPage = application.getSessionSettings()
              .getPageFactory()
              .newPage(pageClass);
          }
View Full Code Here

    {
      throw new IllegalArgumentException("Argument pageClass must be an instance of " +
        Page.class.getName());
    }
    pageClassRef = new WeakReference<Class<? extends Page>>(pageClass);
    this.pageParameters = (pageParameters == null) ? new PageParameters() : pageParameters;
    this.pageMapName = pageMapName;
  }
View Full Code Here

  /**
   * @return page parameters
   */
  public PageParameters getPageParameters()
  {
    PageParameters result = new PageParameters();
    if (parameters != null)
    {
      for (Iterator<Entry<String, Object>> i = parameters.entrySet().iterator(); i.hasNext();)
      {
        Entry<String, Object> entry = i.next();
        result.put(entry.getKey(), entry.getValue());
      }
    }
    return result;
  }
View Full Code Here

    return result;
  }

  private void setParameterImpl(String key, Object value)
  {
    PageParameters parameters = getPageParameters();
    parameters.put(key, value);
    this.parameters = pageParametersToMiniMap(parameters);
  }
View Full Code Here

    if (pageMapName != null && getPopupSettings() != null)
    {
      throw new IllegalStateException("You cannot specify popup settings and a page map");
    }

    PageParameters parameters = getPageParameters();

    if (getPopupSettings() != null)
    {
      return urlFor(getPopupSettings().getPageMap(this), getPageClass(), parameters);
    }
View Full Code Here

          Field parametersField = BookmarkablePageLink.class.getDeclaredField("parameters");
          Method getParametersMethod = BookmarkablePageLink.class.getDeclaredMethod(
            "getPageParameters", (Class[])null);
          getParametersMethod.setAccessible(true);

          PageParameters parameters = (PageParameters)getParametersMethod.invoke(
            bookmarkablePageLink, (Object[])null);
          setParametersForNextRequest(parameters.toRequestParameters());
        }
        catch (Exception e)
        {
          fail("Internal error in WicketTester. "
            + "Please report this in Wickets Issue Tracker.");
View Full Code Here

      encoder.addValue(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME,
        pageMapName + Component.PATH_SEPARATOR + pageClass.getName());
    }

    // Get page parameters
    final PageParameters parameters = requestTarget.getPageParameters();
    if (parameters != null)
    {
      final Iterator iterator;
      if (UnitTestSettings.getSortUrlParameters())
      {
        iterator = new TreeSet(parameters.keySet()).iterator();
      }
      else
      {
        iterator = parameters.keySet().iterator();
      }
      while (iterator.hasNext())
      {
        final String key = (String)iterator.next();
        final String values[] = parameters.getStringArray(key);
        if (values != null)
        {
          for (int i = 0; i < values.length; i++)
          {
            encoder.addValue(key, values[i]);
View Full Code Here

TOP

Related Classes of org.apache.wicket.PageParameters

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.