Package org.apache.wicket

Examples of org.apache.wicket.Page


  {
    Iterator<Component> iterator = markupIdToComponent.values().iterator();
    while (iterator.hasNext())
    {
      final Component component = iterator.next();
      final Page parentPage = component.findParent(Page.class);
      if (parentPage != null)
      {
        parentPage.detach();
        break;
      }
    }
  }
View Full Code Here


    // create the htmlheadercontainer if needed
    if (header == null)
    {
      header = new AjaxHtmlHeaderContainer(this);
      final Page parentPage = component.getPage();
      parentPage.addOrReplace(header);
    }

    RequestCycle requestCycle = component.getRequestCycle();

    // save old response, set new
View Full Code Here

  @Override
  public Component resolve(final MarkupContainer container, final MarkupStream markupStream,
    final ComponentTag tag)
  {
    final Page page = container.getPage();

    // <head> or <wicket:header-items/> component tags have the id == "_header_"
    if (tag.getId().equals(HtmlHeaderSectionHandler.HEADER_ID))
    {
      // Create a special header component which will gather additional
      // input the <head> from 'contributors'.
      return newHtmlHeaderContainer(HtmlHeaderSectionHandler.HEADER_ID +
        page.getAutoIndex(), tag);
    }
    else if ((tag instanceof WicketTag) && ((WicketTag)tag).isHeadTag())
    {
      // If we found <wicket:head> without surrounding <head> on a Page,
      // then we have to add wicket:head into a automatically generated
      // head first.
      if (container instanceof WebPage)
      {
        HtmlHeaderContainer header = container.visitChildren(new IVisitor<Component, HtmlHeaderContainer>()
        {
          @Override
          public void component(final Component component, final IVisit<HtmlHeaderContainer> visit)
          {
            if (component instanceof HtmlHeaderContainer)
            {
              visit.stop((HtmlHeaderContainer) component);
            } else if (component instanceof TransparentWebMarkupContainer == false)
            {
              visit.dontGoDeeper();
            }
          }
        });

        // It is <wicket:head>. Because they do not provide any
        // additional functionality they are merely a means of surrounding relevant
        // markup. Thus we simply create a WebMarkupContainer to handle
        // the tag.
        WebMarkupContainer wicketHeadContainer = new WicketHeadContainer();

        if (header == null)
        {
          // Create a special header component which will gather
          // additional input the <head> from 'contributors'.
          header = newHtmlHeaderContainer(HtmlHeaderSectionHandler.HEADER_ID +
            page.getAutoIndex(), tag);
          header.add(wicketHeadContainer);
          return header;
        }

        header.add(wicketHeadContainer);
        return wicketHeadContainer;
      }
      else if (container instanceof HtmlHeaderContainer)
      {
        // It is <wicket:head>. Because they do not provide any
        // additional functionality there are merely a means of surrounding
        // relevant markup. Thus we simply create a WebMarkupContainer to handle
        // the tag.
        WebMarkupContainer header = new WicketHeadContainer();

        return header;
      }

      final String pageClassName = (page != null) ? page.getClass().getName() : "unknown";
      final IResourceStream stream = markupStream.getResource();
      final String streamName = (stream != null) ? stream.toString() : "unknown";

      throw new MarkupException(
        "Mis-placed <wicket:head>. <wicket:head> must be outside of <wicket:panel>, <wicket:border>, " +
View Full Code Here

          // WICKET-5424 record page after wrapped renderer has
          // responded
          if (handler.getPageProvider().hasPageInstance())
          {
            Page renderedPage = (Page)handler.getPageProvider().getPageInstance();
            if (componentInPage != null && lastPage != null
                && lastPage.getPageClass() != renderedPage.getPageClass())
            {
              // WICKET-3913: reset startComponent if a new page
              // type is rendered
              componentInPage = null;
            }
View Full Code Here

   * @return this
   */
  public final CheckBoxMultipleChoice<T> setPrefix(final String prefix)
  {
    // Tell the page that this component's prefix was changed
    final Page page = findPage();
    if (page != null)
    {
      addStateChange();
    }

View Full Code Here

   * @return this
   */
  public final CheckBoxMultipleChoice<T> setSuffix(final String suffix)
  {
    // Tell the page that this component's suffix was changed
    final Page page = findPage();
    if (page != null)
    {
      addStateChange();
    }

View Full Code Here

   *      default manner
   */
  public void process(IFormSubmitter submittingComponent)
  {
    // save the page in case the component is removed during submit
    final Page page = getPage();
    String hiddenFieldId = getHiddenFieldId();

    if (!isEnabledInHierarchy() || !isVisibleInHierarchy())
    {
      // since process() can be called outside of the default form workflow, an additional
      // check is needed

      // FIXME throw listener exception
      return;
    }

    // run validation
    validate();

    // If a validation error occurred
    if (hasError())
    {
      // mark all children as invalid
      markFormComponentsInvalid();

      // let subclass handle error
      callOnError(submittingComponent);
    }
    else
    {
      // mark all children as valid
      markFormComponentsValid();

      // before updating, call the interception method for clients
      beforeUpdateFormComponentModels();

      // Update model using form data
      updateFormComponentModels();

      // Form has no error
      delegateSubmit(submittingComponent);
    }

    // If the form is stateless page parameters contain all form component
    // values. We need to remove those otherwise they get appended to action URL
    final PageParameters parameters = page.getPageParameters();
    if (parameters != null)
    {
      visitFormComponents(new IVisitor<FormComponent<?>, Void>()
      {
        public void component(final FormComponent<?> formComponent, final IVisit<Void> visit)
View Full Code Here

        }

        IPageManager pageManager = session.getPageManager();
        try
        {
          Page page = getPage(pageManager);

          WebSocketRequestHandler requestHandler = new WebSocketRequestHandler(page, connection);

          WebSocketPayload payload = createEventPayload(message, requestHandler);
View Full Code Here

   *      the page manager to use when finding a page by id
   * @return the page to use when creating WebSocketRequestHandler
   */
  private Page getPage(IPageManager pageManager)
  {
    Page page;
    if (pageId != -1)
    {
      page = (Page) pageManager.getPage(pageId);
    }
    else
View Full Code Here

         */

        // make sure this page instance was just created so the page can be stateless
        if (page.isPageStateless())
        {
          Page p = (Page)page;
          p.internalInitialize();
          p.internalPrepareForRender(false);
          component = page.get(componentPath);
        }
      }
    }
    if (component == null)
View Full Code Here

TOP

Related Classes of org.apache.wicket.Page

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.