You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Don <do...@yahoo.com> on 2012/02/16 15:08:05 UTC

Inheritance with html reuse

Is it possible to reuse the html as well when using inheritance? Say I have base panel class B with B.java and B.html. Now I want to have a descendent panel D with D.java and D.html that just introduces a new label. Instead of just copying the B.html into D.html (which will be a pain for maintenance) and modifying to insert the markup for the new label, is it possible to do it somehow easier, say something like this:

B.html
define part a
define part b

D.html
include directive part a (so it's not a copy of a, it's just saying to copy a in there)

new label
include directive part b

I see that being possible by splitting B into say two panels each one with its own html but it seems rather tedious, especially if you want later to create other descendent panels that want to insert the label (let's say) at other locations.

Tks,