The <body> tag from your subpage is discarded. The <body> tag that is
rendered comes from some parent page. One way to do this would be to
attach a WebMarkupContainer to the <body> tag in the parent page and
expose it via a getter:


I really want to avoid this, as it seems messy having to add all components to the body markupcontainer. I can't believe this is the Wicket way to solve this problem :)

-- Edvin

public class ParentPage extends WebPage {

  private WebMarkupContainer body;

  public ParentPage() {
    body = new WebMarkupContainer("body");
    // need to add all children to the body tag
    // instead of the page
  }

  protected WebMarkupContainter getBody() {
    return body;
  }
}

public class ChildPage extends ParentPage {
  public ChildPage() {
    getBody().add(new SimpleAttributeModifier("class", "foo"));
  }
}

jk

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to