So in my parent html :
body
span wicket:id=myDiv/span
div wicket:id=myNewPanel/div
div wicket:id=myNewPanel2/div
/body
And add a label with id myDiv in related parent java. This part is
common to all classes.
But when I render the TestFormOne, that doesn't work
public abstract class MyPage extends WebPage {
public MyPage() {
add(createMyDiv(myDiv));
}
public abstract Component createMyDiv(String markuId);
}
public MyConcretePage extends MyPage {
public createMyDiv(String markupId) {
That's what I did when the component has to be overriden in subclasses.
But how does it work when the component is common to every concrete page? I
would not want to redefine common component in every concrete page.
Let's see my example, In my parent page :
public abstract class TestForm
Ok,
There was a problem when copy/paste html, sorry about that:
TestForm.html (parent html):
body
div wicket:id=myNewPanel/div
div wicket:id=myNewPanel2/div
/body
and TestFormOne.html(subclass html):
body
wicket:fragment wicket:id=myNewPanel
/wicket:fragment
Hi,
I think you should provide component classes that are responsible for sub
elements
class TestFormPanel extends Panel {
public TestFormPanel(String markupId) {
super(markupId);
add(new Label(label,My very good label 1));
}
}
public abstract class TestForm extends WebPage {
public TestForm() {
add(new Label(myDiv, my div from test form)); = common to
every
concrete page
add(createDivWithComponent(myNewPanel)); = has to be
redefine by
each concrete page