Wicket programming model

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Wicket programming model

WickedNoob
Hi,
I'm fairly new to Wicket. I like its core principle but I'm also missing a, in my opinion, pretty crucial feature.
What I'd like to do:

Define a component

class MyPanel extends Panel {
       ...
}

Define its markup

<html xmls:wicket....>
    <wicket:panel>
        This is my panel <br />
        <wicket:subComponents/>
    </wicket:panel>
</html>

Define a Page

class MyPage extends WebPage {
     
      public MyPage() {
            super();
            MyPanel panel = new MyPanel("myPanel"));
            panel.add(new Component...);
            panel.add(new Component...);
            ...
      }
}

You see I'd like to nest components into other components without explicitly adding the nested components in the markup and specifying an Id.
That way I can map a Java class to a markup snippet once and completely describe the whole markup of any page in Java just by building the component tree.

The question now is: Can it be done? If yes, how?