You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Petr Fejfar <pe...@gmail.com> on 2009/06/21 15:59:03 UTC

Help with design of application layout

Hi everybody,

I am new in Wicket: I choose it as the most promissing Java web
framework today when looking for framework we could use instead of
Django and dynamically typed Python.

I read books Enjoy Web Dev .... and Wicket in Action, but I am still
not able to move forward with design of skeleton for our applications.
Probably because of not being able to step over Django's generic
inheritence of the markup templates with (logicaly) unlimited number
of inherited blocks inside each markup file and unlimited number of
page's descendants.

I tried various combinations of markup inheritance with panels
inheritence, but I'm not satisfied with it.

Please, could some push me forward with application design containig
multiple varying parts per page?


Thx, Petr

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Help with design of application layout

Posted by Petr Fejfar <pe...@gmail.com>.
On Mon, Jun 22, 2009 at 3:52 PM, Igor Vaynberg<ig...@gmail.com> wrote:

> 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"));
>   }

Hi Igor,

thanks for your help. I followed your recommendation and I've achieved
the goal. Great!

FYI,

- I've merged two first layers into AbstractPage with <wicket:child> as
  placeholder of zones c (z.a excluded)
- The extended page contains three RepeatingViews for zones c.b, c.c and c.d
- A chain of descendants relaying on POJO inheritance populates
  those RepeatingViews by panels.

Thx, Petr

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Help with design of application layout

Posted by Igor Vaynberg <ig...@gmail.com>.
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<pe...@gmail.com> wrote:
> On Mon, Jun 22, 2009 at 7:21 AM, Igor Vaynberg<ig...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Help with design of application layout

Posted by Petr Fejfar <pe...@gmail.com>.
On Mon, Jun 22, 2009 at 7:21 AM, Igor Vaynberg<ig...@gmail.com> 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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Help with design of application layout

Posted by Igor Vaynberg <ig...@gmail.com>.
i think you will get more help if you present a concrete usecase.

-igor

On Sun, Jun 21, 2009 at 6:59 AM, Petr Fejfar<pe...@gmail.com> wrote:
> Hi everybody,
>
> I am new in Wicket: I choose it as the most promissing Java web
> framework today when looking for framework we could use instead of
> Django and dynamically typed Python.
>
> I read books Enjoy Web Dev .... and Wicket in Action, but I am still
> not able to move forward with design of skeleton for our applications.
> Probably because of not being able to step over Django's generic
> inheritence of the markup templates with (logicaly) unlimited number
> of inherited blocks inside each markup file and unlimited number of
> page's descendants.
>
> I tried various combinations of markup inheritance with panels
> inheritence, but I'm not satisfied with it.
>
> Please, could some push me forward with application design containig
> multiple varying parts per page?
>
>
> Thx, Petr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org