SV: SV: Override fragments in subclasses

2010-01-25 Thread Wilhelmsen Tor Iver
> 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 > add(createD

Re: SV: Override fragments in subclasses

2010-01-25 Thread Ilja Pavkovic
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")); } } TestFormPanel.

Re: SV: Override fragments in subclasses

2010-01-25 Thread aurelie.boiteux
Ok, There was a problem when copy/paste html, sorry about that: TestForm.html (parent html): and TestFormOne.html(subclass html): aurelie.boiteux wrote: > > That's what I did when the component has to be overriden in subclasses. > But h

Re: SV: Override fragments in subclasses

2010-01-25 Thread aurelie.boiteux
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 extend

Re: SV: Override fragments in subclasses

2010-01-25 Thread Ilja Pavkovic
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) { re

SV: Override fragments in subclasses

2010-01-25 Thread Wilhelmsen Tor Iver
> So in my parent html : > > > > > > > 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 because, > apparently the label "myDiv" must be define in subclass. You should add