use of org.apache.wicket.Page in project wicket by apache.
the class CheckBoxMultipleChoice method setPrefix.
/**
* @param prefix
* Prefix to use before choice
* @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();
}
this.prefix = prefix;
return this;
}
use of org.apache.wicket.Page in project wicket by apache.
the class MarkupUtil method isMarkupHtml5Compliant.
/**
* @param container
* @return True if the Page and all it's Panels, Borders etc. have HTML5 compliant markup. HTML5
* markup is identified by <DOCTYPE html>
*/
public static boolean isMarkupHtml5Compliant(final MarkupContainer container) {
Args.notNull(container, "container");
Page page = container.getPage();
final boolean[] rtn = new boolean[] { true };
page.visitChildren(MarkupContainer.class, new IVisitor<MarkupContainer, Void>() {
@Override
public void component(final MarkupContainer comp, final IVisit<Void> visit) {
IMarkupFragment associatedMarkup = comp.getAssociatedMarkup();
if (associatedMarkup != null) {
MarkupResourceStream rs = associatedMarkup.getMarkupResourceStream();
if (rs.isHtml5() == false) {
rtn[0] = false;
visit.stop();
}
}
}
});
return rtn[0];
}
use of org.apache.wicket.Page in project wicket by apache.
the class StatelessAjaxFallbackLinkDoNotRecreateTest method statelessPagesAreAlwaysRecreated.
/**
* https://issues.apache.org/jira/browse/WICKET-6349
*/
@Test
public void statelessPagesAreAlwaysRecreated() {
tester.getApplication().getPageSettings().setRecreateBookmarkablePagesAfterExpiry(false);
tester.startPage(StatelessAjaxFallbackLinkDoNotRecreatePage.class);
final Page page = tester.getLastRenderedPage();
assertTrue(page.isStateless());
tester.clickLink("incrementLink");
tester.assertRenderedPage(StatelessAjaxFallbackLinkDoNotRecreatePage.class);
}
use of org.apache.wicket.Page in project wicket by apache.
the class AjaxLinkTest method page_2.
/**
* @throws Exception
*/
@Test
public void page_2() throws Exception {
executeTest(AjaxPage2.class, "AjaxPage2_ExpectedResult.html");
Page page = tester.getLastRenderedPage();
Component ajaxLink = page.get("pageLayout:pageLayout_body:ajaxLink");
AbstractAjaxBehavior behavior = (AbstractAjaxBehavior) ajaxLink.getBehaviors().get(0);
executeBehavior(behavior, "AjaxPage2-1_ExpectedResult.html");
}
use of org.apache.wicket.Page in project wicket by apache.
the class DequeueingTransparentWebMarkupContainerTest method queuedComponentsInsideTransparentContainer.
/**
* https://issues.apache.org/jira/browse/WICKET-5724
*
* Transparent component inside page body must allow
* queued children components.
*
* https://issues.apache.org/jira/browse/WICKET-5964
*
* Queuing a component within an enclosure
*/
@Test
public void queuedComponentsInsideTransparentContainer() {
tester.startPage(TransparentContainerQueuePage.class);
tester.assertRenderedPage(TransparentContainerQueuePage.class);
Page lastRenderedPage = tester.getLastRenderedPage();
// test if page contains the queued label
boolean containsQueuedLabel = lastRenderedPage.visitChildren(new IVisitor<Component, Boolean>() {
@Override
public void component(Component component, IVisit<Boolean> visit) {
if (component instanceof Label) {
visit.stop(true);
}
}
});
assertTrue(containsQueuedLabel);
}
Aggregations