Igor Vaynberg wrote:
variants and styles work on component level...pages inherit that
functionality from components

Right, I think I understand how this works now (simpler than I thought!).

I find the Wiki page a bit short on info. I suggest to add some explanatory introduction like:

------------------------------8<------------------------------

Each Wicket component has at least one associated markup (in the form of an HTML file). It is possible to have multiple markup alternatives for one component. These are called "variations", and have an HTML file with a name like "ComponentName_foo.html". Which markup variation is used, is determined by the getVariation() method of Component, i.e. if it returns the string "foo", the HTML file "ComponentName_foo.html" is loaded instead of "ComponentName.html".

Variations are inherited down the component hierarchy, and the default is null, which means no variation (i.e. load "ComponentName.html"). Any component can override the getVariation() method to change this behaviour.

If a markup variation with the name returned by getVariation() is not found, Wicket will load the default markup for that component.

The example below shows how you can use a request parameter to load different markup variations for a Page on the fly.

[and then the example which is already on the page]

------------------------------8<------------------------------

If this make sense I'll add it to the page. Or is this already documented somewhere else?

Regards

Niels



-igor

On Nov 22, 2007 7:40 AM, Niels van Kampenhout <[EMAIL PROTECTED]> wrote:
Hello Wicketeers,

I read about markup variants on the wiki [1]. I need this, however I
need it on component level rather than page level. Is this possible?

In the most extreme case I would like to have different instances of the
same component on one page, but each with their own markup variant.

The workaround I use right now is extending my component with an empty
class for each variant.

Thanks

Niels

[1] http://cwiki.apache.org/WICKET/multiple-markups-per-page.html


---------------------------------------------------------------------
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to