THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
. There are however a number of typical solutions.
Use Model
Code Block |
---|
public abstract class Template extends WebPage {
public Template(PageParameters params) {
super(params);
add(new Label("headerTitle", getPageTitle()));
}
protected abstract IModel<String> getPageTitle();
}
|
This way the model implementation will be constructed at component construction time but its #getObject() will be called at component rendering time and the object we need will be already properly constructed.
Two-phase construction with an internal init() method called by subclasses
...