Search in sources :

Example 56 with Label

use of org.apache.wicket.markup.html.basic.Label in project wicket by apache.

the class OnReAddTest method onReAddEnforcesSuperCall.

@Test
public void onReAddEnforcesSuperCall() {
    Page page = createPage();
    page.internalInitialize();
    Label brokenProbe = new Label("foo") {

        @Override
        protected void onReAdd() {
            // I should call super, but since I don't, this should throw an exception
            ;
        }
    };
    brokenProbe.internalInitialize();
    page.add(brokenProbe);
    page.remove(brokenProbe);
    try {
        page.add(brokenProbe);
        fail("should have thrown exception");
    } catch (IllegalStateException e) {
        assertTrue(e.getMessage().contains("super.onReAdd"));
    }
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) WebPage(org.apache.wicket.markup.html.WebPage) Test(org.junit.Test)

Example 57 with Label

use of org.apache.wicket.markup.html.basic.Label in project wicket by apache.

the class PanelEdit method createSubmitButton.

private AjaxButton createSubmitButton() {
    AjaxButton submit = new AjaxButton("submit") {

        protected void onSubmit(AjaxRequestTarget target) {
            Component currentcomponent = PanelEdit.this;
            Component newComponent = new Label(currentcomponent.getId()).setOutputMarkupId(true);
            currentcomponent.replaceWith(newComponent);
            target.add(newComponent);
        }
    };
    return submit;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxButton(org.apache.wicket.ajax.markup.html.form.AjaxButton) Label(org.apache.wicket.markup.html.basic.Label) Component(org.apache.wicket.Component)

Example 58 with Label

use of org.apache.wicket.markup.html.basic.Label in project wicket by apache.

the class ComponentQueueingTest method autosInsideNotQueueRegion.

/**
 * Test autocomponent inside not-queue region
 */
@Test
public void autosInsideNotQueueRegion() {
    TestPage p = new TestPage();
    p.setPageMarkup("<div wicket:id='outerContainer'><wicket:enclosure><div wicket:id='a'></div></wicket:enclosure></div>");
    Label a = new Label("a", "a");
    WebMarkupContainer outer;
    p.add(outer = new WebMarkupContainer("outerContainer"));
    outer.queue(a);
    tester.startPage(p);
    assertTrue(a.getParent() instanceof Enclosure);
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) Enclosure(org.apache.wicket.markup.html.internal.Enclosure) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) TransparentWebMarkupContainer(org.apache.wicket.markup.html.TransparentWebMarkupContainer) Test(org.junit.Test)

Example 59 with Label

use of org.apache.wicket.markup.html.basic.Label in project wicket by apache.

the class ComponentQueueingTest method queueBorderBody.

@Test
public void queueBorderBody() throws Exception {
    TestBorder border = new TestBorder("border");
    border.setBorderMarkup("<wicket:border><wicket:body/></wicket:border>");
    TestPage p = new TestPage();
    p.setPageMarkup("<div wicket:id=\"border\"><span wicket:id=\"label\"></span></div>");
    p.add(border);
    border.queue(new Label("label", "test"));
    tester.startPage(p);
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) Test(org.junit.Test)

Example 60 with Label

use of org.apache.wicket.markup.html.basic.Label in project wicket by apache.

the class ComponentQueueingTest method queueComponentInsideBorderAndEnclosure.

@Test
public void queueComponentInsideBorderAndEnclosure() {
    TestPage page = new TestPage();
    page.setPageMarkup(" <div wicket:id=\"panel\"></div>");
    TestPanel panel = new TestPanel("panel");
    panel.setPanelMarkup("<wicket:panel>\n" + "<div wicket:id=\"border\">\n" + "    <div wicket:enclosure=\"child\">\n" + "      <p wicket:id=\"child\">1</p>\n" + "    </div>\n" + "  </div>\n" + "</wicket:panel>");
    TestBorder border = new TestBorder("border");
    border.setBorderMarkup("<wicket:border><wicket:body/></wicket:border>");
    panel.add(border);
    page.add(panel);
    border.add(new Label("child"));
    tester.startPage(page);
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) Test(org.junit.Test)

Aggregations

Label (org.apache.wicket.markup.html.basic.Label)519 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)189 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)181 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)121 IModel (org.apache.wicket.model.IModel)116 ListItem (org.apache.wicket.markup.html.list.ListItem)84 ListView (org.apache.wicket.markup.html.list.ListView)70 ArrayList (java.util.ArrayList)68 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)65 PropertyModel (org.apache.wicket.model.PropertyModel)61 Test (org.junit.Test)56 List (java.util.List)51 InfoTooltipBehavior (com.evolveum.midpoint.web.util.InfoTooltipBehavior)47 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)46 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)41 Model (org.apache.wicket.model.Model)36 Item (org.apache.wicket.markup.repeater.Item)35 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)34 AttributeModifier (org.apache.wicket.AttributeModifier)32 Component (org.apache.wicket.Component)30