from what you have shown here there doesnt seem anything common you
can factor out.
if i were you i would create something like this:
class zonepage extends webpage {
private final repatingview zones;
public zonepage() {
add(zones=new repeatingview("zones"));
}
public void addzone(component c) {zones.add(c);}
public int nextzoneid() { return zones.newchildid(); }
}
[html][body][wicket:container
wicket:id="zones"][/wicket:container][/body][/html]
then you can factor out common things like layout into panels so your
code looks like this:
class mypage extends zonepage {
class mypage {
component leftcolcontent=...;
component rightcolcontent=..;
component centercontent=..;
addzone(new leftzonepanel(nextzoneid(), leftcolcontent));
addzone(new rightzonepanel(nextzoneid(), rightcolcontent));
addzone(new centerzonepanel(nextzoneid(), centerzonepanel));
}}
-igor
On Sun, Jun 21, 2009 at 11:20 PM, Petr Fejfar<[email protected]> wrote:
> On Mon, Jun 22, 2009 at 7:21 AM, Igor Vaynberg<[email protected]> wrote:
>
>> i think you will get more help if you present a concrete usecase.
>
> Thanks for your reply. Ok, I'd like to design something like this:
>
> layer[0]
> - zone.a (a banner, sometimes visible, sometimes not).
> - zone.b (FeedbackPanel)
> - zone.c (abstract. A content)
> - zone.d (a footer)
> - zone.e (debug output)
>
> layer[1]
> - zone.c (overriden by)
> - zone.c.a (header)
> - zone.c.b (abstract. Left column )
> - zone c.c (abstract. Central column)
> - zone c.d (abstract. Right column)
>
> layer[2]
> - zone.c.d overriden by
> - zone.c.d.a (user box i.e. login/logout panel etc...)
> - zone.c.d.b (abstract. A content)
>
> layer[3a]
> - zone.c.b overriden by
> - zone c.b.a (ref box)
> - zone.c.b.b (a content)
> - zone.c.c overriden (content)
> - zone.c.d.b overriden by
> - zone c.d.b.a (content)
>
> layer[3b]
> - zone.c.b overriden by
> - zone c.b.a (status box)
> - zone.c.b.b (menu)
> - zone.c.c overriden (content)
> - zone.c.d.b overriden by
> - zone c.d.b.a (content)
>
> layer[3c]
> ...
>
> My attempts to build something like this was unsuccessfull. From the
> perspective of my current wicket's knowledge/experience it seems I
> could achieve this using a base page fragmented down to the collection
> of smallest zones of all top-most layers and override/show/hide them
> in particular page. But it'd probably violate DRY principe: I'd have
> to include common (inherited) panels in fragments in all ancestors...
>
> Thx, Petr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]