Package org.apache.wicket.markup.html.border

Examples of org.apache.wicket.markup.html.border.Border$BorderBodyContainer


   * @throws Exception
   */
  public void testBorder() throws Exception
  {
    Page page = new MyBorderPage();
    Border border = (Border)page.get("border");

    // Get the associated markup file
    IMarkupFragment markup = border.getAssociatedMarkup();
    compareWithFile(markup, "MyBorder_ExpectedResult.html");

    // getMarkup() returns the "calling" tags
    markup = border.getMarkup();
    compare(markup, "<span wicket:id=\"border\">test</span>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getMarkup(null);
    compare(markup, "<wicket:border>  111  <wicket:body/>  222</wicket:border>");

    assertNull(border.getBodyContainer().getAssociatedMarkup());

    markup = border.getBodyContainer().getMarkup();
    compare(markup, "<wicket:body/>");

    markup = border.getBodyContainer().getMarkup(null);
    compare(markup, "<span wicket:id=\"border\">test</span>");

    markup = border.getBodyContainer().getParent().getMarkup(border.getBodyContainer());
    compare(markup, "<wicket:body/>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getBodyContainer().getMarkup(null);
    compare(markup, "<span wicket:id=\"border\">test</span>");
  }
View Full Code Here


   * @throws Exception
   */
  public void testBorder2() throws Exception
  {
    Page page = new MyBorderPage();
    Border border = (Border)page.get("border2");

    // Get the associated markup file
    IMarkupFragment markup = border.getAssociatedMarkup();
    compareWithFile(markup, "MyBorder2_ExpectedResult.html");

    // getMarkup() returns the "calling" tags
    markup = border.getMarkup();
    compare(markup, "<span wicket:id=\"border2\">test</span>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getMarkup(null);
    compare(markup, "<wicket:border>  111  <wicket:body>333</wicket:body>  222</wicket:border>");

    assertNull(border.getBodyContainer().getAssociatedMarkup());

    // See explanation in BaseBorder.BorderBodyContainer.getMarkup()
    markup = border.getBodyContainer().getParent().getMarkup(border.getBodyContainer());
    compare(markup, "<wicket:body>333</wicket:body>");

    markup = border.getBodyContainer().getMarkup();
    compare(markup, "<wicket:body>333</wicket:body>");

    markup = border.getBodyContainer().getMarkup(null);
    compare(markup, "<span wicket:id=\"border2\">test</span>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getBodyContainer().getMarkup(null);
    compare(markup, "<span wicket:id=\"border2\">test</span>");
  }
View Full Code Here

  /**
   * Construct.
   */
  public AjaxLinkWithBorderPage()
  {
    Border border = new AjaxTestBorder("border");
    add(border);

    final Label label = new Label("ajaxLabel", new PropertyModel<String>(this, "labelText"));
    label.setOutputMarkupId(true);
    border.addToBorderBody(label);
    border.addToBorderBody(new AjaxLink("ajaxLink")
    {
      private static final long serialVersionUID = 1L;

      @Override
      public void onClick(AjaxRequestTarget target)
View Full Code Here

  /**
   * Construct.
   */
  public AjaxLinkWithBorderPage()
  {
    Border border = new AjaxTestBorder("border");
    add(border);

    final Label label = new Label("ajaxLabel", new PropertyModel<String>(this, "labelText"));
    label.setOutputMarkupId(true);
    border.addToBorderBody(label);
    border.addToBorderBody(new AjaxLink<Void>("ajaxLink")
    {
      private static final long serialVersionUID = 1L;

      @Override
      public void onClick(AjaxRequestTarget target)
View Full Code Here

   * @throws Exception
   */
  public void testBorder() throws Exception
  {
    Page page = new MyBorderPage();
    Border border = (Border)page.get("border");

    // Get the associated markup file
    IMarkupFragment markup = border.getAssociatedMarkup();
    compareMarkupWithFile(markup, "MyBorder_ExpectedResult.html");

    // getMarkup() returns the "calling" tags
    markup = border.getMarkup();
    compareMarkupWithString(markup, "<span wicket:id=\"border\">test</span>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getMarkup(null);
    compareMarkupWithString(markup, "<wicket:border>  111  <wicket:body/>  222</wicket:border>");

    assertNull(border.getBodyContainer().getAssociatedMarkup());

    markup = border.getBodyContainer().getMarkup();
    compareMarkupWithString(markup, "<wicket:body/>");

    markup = border.getBodyContainer().getMarkup(null);
    compareMarkupWithString(markup, "<span wicket:id=\"border\">test</span>");

    markup = border.getBodyContainer().getParent().getMarkup(border.getBodyContainer());
    compareMarkupWithString(markup, "<wicket:body/>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getBodyContainer().getMarkup(null);
    compareMarkupWithString(markup, "<span wicket:id=\"border\">test</span>");
  }
View Full Code Here

   * @throws Exception
   */
  public void testBorder2() throws Exception
  {
    Page page = new MyBorderPage();
    Border border = (Border)page.get("border2");

    // Get the associated markup file
    IMarkupFragment markup = border.getAssociatedMarkup();
    compareMarkupWithFile(markup, "MyBorder2_ExpectedResult.html");

    // getMarkup() returns the "calling" tags
    markup = border.getMarkup();
    compareMarkupWithString(markup, "<span wicket:id=\"border2\">test</span>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getMarkup(null);
    compareMarkupWithString(markup,
      "<wicket:border>  111  <wicket:body>333</wicket:body>  222</wicket:border>");

    assertNull(border.getBodyContainer().getAssociatedMarkup());

    // See explanation in BaseBorder.BorderBodyContainer.getMarkup()
    markup = border.getBodyContainer().getParent().getMarkup(border.getBodyContainer());
    compareMarkupWithString(markup, "<wicket:body>333</wicket:body>");

    markup = border.getBodyContainer().getMarkup();
    compareMarkupWithString(markup, "<wicket:body>333</wicket:body>");

    // getMarkup(null) returns the markup which is used to find a child component
    markup = border.getBodyContainer().getMarkup(null);
    compareMarkupWithString(markup, "<span wicket:id=\"border2\">test</span>");
  }
View Full Code Here

            }
          }

          // Check if this component is a child of a border whose body is invisible and if
          // so ignore it
          Border border = component.findParent(Border.class);
          if (border != null && !border.getBodyContainer().isVisibleInHierarchy())
          {
            // Suppose:
            //             
            // <div wicket:id="border"><div wicket:id="label"></div> suppose
            // border->label and border's body is hidden.
View Full Code Here

    Form<?> form = component.findParent(Form.class);
    if (form == null)
    {
      // check whether the form is a child of a surrounding border
      Border border = component.findParent(Border.class);
      while ((form == null) && (border != null))
      {
        FindFormVisitor formVisitor = new FindFormVisitor();
        border.visitChildren(Form.class, formVisitor);
        form = formVisitor.form;
        if (form == null)
        {
          border = border.findParent(Border.class);
        }
      }
    }
    return form;
View Full Code Here

    document = tester.getServletResponse().getDocument();
    assertNotNull(document);
    assertFalse("".equals(document));
    assertEquals("<span wicket:id=\"label\">mein Label</span>", document);

    Border border = (Border)tester.getLastRenderedPage().get("myBorder");
    assertNotNull(border);
    tester.processRequestCycle(border);
    document = tester.getServletResponse().getDocument();
    assertNotNull(document);
    assertFalse("".equals(document));
View Full Code Here

    document = tester.getServletResponse().getDocument();
    assertNotNull(document);
    assertFalse("".equals(document));
    assertEquals("<span wicket:id=\"label\">mein Label</span>", document);

    Border border = (Border)page.get("myBorder");
    assertNotNull(border);
    tester.processRequestCycle(border);
    document = tester.getServletResponse().getDocument();
    assertNotNull(document);
    assertFalse("".equals(document));
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.border.Border$BorderBodyContainer

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.