You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Kram.V" <v....@yahoo.com> on 2008/06/11 22:21:09 UTC

Multiple Layouts using Inheritance

In Wicket is it possible to inherit from multiple layouts?

What we are trying to do is introduce different skins for the same
application (We could control all of this in CSS and forget about it, but
want to try this first)

Each skin is a different Layout Page/Class in Wicket, how can we switch the
inheriting Page/Class's layout.

For instance:

Class Skin1 extends WebPage
Class Skin2 extends WebPage

abstract BasePage() - Don't know how to design this one yet!

MyPage extends BasePage

and MyPage should use either Skin1 or Skin2 based on some criteria inside of
BasePage.

Is this even doable ?

Thanks




-- 
View this message in context: http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786400.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Multiple Layouts using Inheritance

Posted by Al Maw <wi...@almaw.com>.
Note that you can also override the style in your Component class (e.g. your
WebPage subclass). The default implementation for getStyle() calls
getVariation(), etc. Best to look at the source to see exactly how it works.

Regards,

Alastair

2008/6/11 Gwyn Evans <gw...@gmail.com>:

>
> http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/Session.html#setStyle(java.lang.String)<http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/Session.html#setStyle%28java.lang.String%29>
>
> On Wed, Jun 11, 2008 at 9:33 PM, Kram.V <v....@yahoo.com> wrote:
>
> >
> > No, I have not. I am going to start looking. If you have any
> > links/documentation do let me know.
> > Thank you for your help.
> >
> >
> >
> > jwcarman wrote:
> > >
> > > Have you looked at using styles?
> > >
> > > On Wed, Jun 11, 2008 at 4:21 PM, Kram.V <v....@yahoo.com> wrote:
> > >>
> > >> In Wicket is it possible to inherit from multiple layouts?
> > >>
> > >> What we are trying to do is introduce different skins for the same
> > >> application (We could control all of this in CSS and forget about it,
> > but
> > >> want to try this first)
> > >>
> > >> Each skin is a different Layout Page/Class in Wicket, how can we
> switch
> > >> the
> > >> inheriting Page/Class's layout.
> > >>
> > >> For instance:
> > >>
> > >> Class Skin1 extends WebPage
> > >> Class Skin2 extends WebPage
> > >>
> > >> abstract BasePage() - Don't know how to design this one yet!
> > >>
> > >> MyPage extends BasePage
> > >>
> > >> and MyPage should use either Skin1 or Skin2 based on some criteria
> > inside
> > >> of
> > >> BasePage.
> > >>
> > >> Is this even doable ?
> > >>
> > >> Thanks
> > >>
> > >>
> > >>
> > >>
> > >> --
> > >> View this message in context:
> > >>
> >
> http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786400.html
> > >> Sent from the Wicket - User mailing list archive at Nabble.com.
> > >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> 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
> > >
> > >
> > >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786644.html
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: Multiple Layouts using Inheritance

Posted by Gwyn Evans <gw...@gmail.com>.
http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/Session.html#setStyle(java.lang.String)

On Wed, Jun 11, 2008 at 9:33 PM, Kram.V <v....@yahoo.com> wrote:

>
> No, I have not. I am going to start looking. If you have any
> links/documentation do let me know.
> Thank you for your help.
>
>
>
> jwcarman wrote:
> >
> > Have you looked at using styles?
> >
> > On Wed, Jun 11, 2008 at 4:21 PM, Kram.V <v....@yahoo.com> wrote:
> >>
> >> In Wicket is it possible to inherit from multiple layouts?
> >>
> >> What we are trying to do is introduce different skins for the same
> >> application (We could control all of this in CSS and forget about it,
> but
> >> want to try this first)
> >>
> >> Each skin is a different Layout Page/Class in Wicket, how can we switch
> >> the
> >> inheriting Page/Class's layout.
> >>
> >> For instance:
> >>
> >> Class Skin1 extends WebPage
> >> Class Skin2 extends WebPage
> >>
> >> abstract BasePage() - Don't know how to design this one yet!
> >>
> >> MyPage extends BasePage
> >>
> >> and MyPage should use either Skin1 or Skin2 based on some criteria
> inside
> >> of
> >> BasePage.
> >>
> >> Is this even doable ?
> >>
> >> Thanks
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786400.html
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786644.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Multiple Layouts using Inheritance

Posted by "Kram.V" <v....@yahoo.com>.
No, I have not. I am going to start looking. If you have any
links/documentation do let me know.
Thank you for your help.



jwcarman wrote:
> 
> Have you looked at using styles?
> 
> On Wed, Jun 11, 2008 at 4:21 PM, Kram.V <v....@yahoo.com> wrote:
>>
>> In Wicket is it possible to inherit from multiple layouts?
>>
>> What we are trying to do is introduce different skins for the same
>> application (We could control all of this in CSS and forget about it, but
>> want to try this first)
>>
>> Each skin is a different Layout Page/Class in Wicket, how can we switch
>> the
>> inheriting Page/Class's layout.
>>
>> For instance:
>>
>> Class Skin1 extends WebPage
>> Class Skin2 extends WebPage
>>
>> abstract BasePage() - Don't know how to design this one yet!
>>
>> MyPage extends BasePage
>>
>> and MyPage should use either Skin1 or Skin2 based on some criteria inside
>> of
>> BasePage.
>>
>> Is this even doable ?
>>
>> Thanks
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786400.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786644.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Multiple Layouts using Inheritance

Posted by James Carman <ja...@carmanconsulting.com>.
Have you looked at using styles?

On Wed, Jun 11, 2008 at 4:21 PM, Kram.V <v....@yahoo.com> wrote:
>
> In Wicket is it possible to inherit from multiple layouts?
>
> What we are trying to do is introduce different skins for the same
> application (We could control all of this in CSS and forget about it, but
> want to try this first)
>
> Each skin is a different Layout Page/Class in Wicket, how can we switch the
> inheriting Page/Class's layout.
>
> For instance:
>
> Class Skin1 extends WebPage
> Class Skin2 extends WebPage
>
> abstract BasePage() - Don't know how to design this one yet!
>
> MyPage extends BasePage
>
> and MyPage should use either Skin1 or Skin2 based on some criteria inside of
> BasePage.
>
> Is this even doable ?
>
> Thanks
>
>
>
>
> --
> View this message in context: http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786400.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: Multiple Layouts using Inheritance

Posted by Al Maw <wi...@almaw.com>.
It doesn't sound like you're trying to "inherit" anything, not in the
object-oriented sense of the term. Instead you just want to use different
markup for a page dependent on some criteria.

Wicket already does this for localised versions of a page.
HomePage.html
HomePage_de.html
HomePage_fr.html
etc.

Wicket will select the variation here by default based on the locale of your
session (picked up from the browser's language headers). However, you can
trivially override how this works by overriding the getVariation() method in
your WebPage subclass and returning something else.

Best regards,

Alastair



2008/6/11 Kram.V <v....@yahoo.com>:

>
> In Wicket is it possible to inherit from multiple layouts?
>
> What we are trying to do is introduce different skins for the same
> application (We could control all of this in CSS and forget about it, but
> want to try this first)
>
> Each skin is a different Layout Page/Class in Wicket, how can we switch the
> inheriting Page/Class's layout.
>
> For instance:
>
> Class Skin1 extends WebPage
> Class Skin2 extends WebPage
>
> abstract BasePage() - Don't know how to design this one yet!
>
> MyPage extends BasePage
>
> and MyPage should use either Skin1 or Skin2 based on some criteria inside
> of
> BasePage.
>
> Is this even doable ?
>
> Thanks
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786400.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>