wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thibault Kruse <tibokr...@googlemail.com>
Subject Re: Variant Change Behavior
Date Fri, 05 Sep 2014 13:30:00 GMT
Thanks Martin,

that works for us. I missed that Variants are inherited from parents.

Is there also a good way that I can assure in our unit tests that the
variant markup for certain components exists and was found? Else a
typo would go unnoticed in the unit tests.

cheers,
  Thibault

On Wed, Sep 3, 2014 at 12:59 PM, Martin Grigorov <mgrigorov@apache.org> wrote:
> Hi,
>
> The behaviors are not used for variations.
> For such use cases you should
> override org.apache.wicket.Component#getVariation() on the (base) page.
> This way all components will know the correct variation.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
>
> On Wed, Sep 3, 2014 at 1:09 PM, Thibault Kruse <tibokruse@googlemail.com>
> wrote:
>
>> Hi,
>>
>> playing around with Variants for Components, I am wondering whether
>> there is an elegant way to steer Variant markup loading via a
>> Behavior.
>>
>> In our case we want to use a different markup layout based on the
>> width of the container the component is going to be used in, visually.
>>
>> So if we imagine a Browser window with desktop size, we might want to
>> use a component on the full width, on a third of the width, or a
>> quarter of the width.
>>
>> For each such container width, we need different responsive design
>> markup. Since this may affect many of our components which inherit
>> from different wicket components, I'd like to just add another html
>> markup file for the variant, and add a Behavior to the component that
>> decides the Variant.
>>
>> cheers,
>>   Thibault
>>
>> ---------------------------------------------------------------------
>> 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


Mime
View raw message