RSS

Wicket Markup Inheritance

15 Feb

Markup Inheritance lets a Component extend the markup of its super class. The subclass markup is inserted at one point in the super class markup.

Let’s see an example:

Parent.java:
public class Parent extends Component {}

Parent.html:

… parent content …
<wicket:child/>
… parent content …

Child.html

<wicket:extend>
… child content …
</wicket:extend>

Child.java:
public class Child extends Parent {}
Renders as:

… parent content …
… child content …
… parent content …

It is just like having a Panel defined in your Component class markup, and let subclasses add the Panel. But it doesn’t need an extra Component and is much easier to use. Markup Inheritance is also a convenient replacement for most Border components.

Markup Inheritance works with WebPages, so you can easily use the same header and footer on several pages.

About these ads
 
1 Comment

Posted by on February 15, 2012 in Computers, Framework, Wicket

 

Tags: , ,

One response to “Wicket Markup Inheritance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 907 other followers

%d bloggers like this: