Search in sources :

Example 1 with InlinePanelPage_1

use of org.apache.wicket.markup.html.panel.InlinePanelPage_1 in project wicket by apache.

the class MarkupFragmentTest method fragments.

/**
 * @throws Exception
 */
@Test
public void fragments() throws Exception {
    Page page = new InlinePanelPage_1();
    Fragment fragment = (Fragment) page.get("myPanel1");
    // Get the associated markup file
    IMarkupFragment markup = fragment.getAssociatedMarkup();
    assertNull(markup);
    // getMarkup() returns the "calling" tags
    markup = fragment.getMarkup();
    compareMarkupWithString(markup, "<span wicket:id=\"myPanel1\">panel</span>");
    // getMarkup(null) returns the markup which is used to find a child component
    markup = fragment.getMarkup(null);
    compareMarkupWithString(markup, "<wicket:fragment wicket:id=\"frag1\">panel 1</wicket:fragment>");
}
Also used : InlinePanelPage_1(org.apache.wicket.markup.html.panel.InlinePanelPage_1) Page(org.apache.wicket.Page) IMarkupFragment(org.apache.wicket.markup.IMarkupFragment) Fragment(org.apache.wicket.markup.html.panel.Fragment) IMarkupFragment(org.apache.wicket.markup.IMarkupFragment) Test(org.junit.Test)

Aggregations

Page (org.apache.wicket.Page)1 IMarkupFragment (org.apache.wicket.markup.IMarkupFragment)1 Fragment (org.apache.wicket.markup.html.panel.Fragment)1 InlinePanelPage_1 (org.apache.wicket.markup.html.panel.InlinePanelPage_1)1 Test (org.junit.Test)1