Answers below.

On 7/24/06, James Cook <[EMAIL PROTECTED]> wrote:
> What is the best practice in 1.2 and 2.0 for developing a component that has
> different visual orientations depending on the developers purpose?
> For example, suppose I am writing a component to display advertising blurbs
> like Google's Adwords. The component can have a vertical or horizontal
> layout. Also suppose for the sake of argument, the layout orientation cannot
> be controlled via CSS. Since there is only one markup file associated with a
> component (true?)

false. Multiple markup files can be associated by overriding a method
in a component. But it's not the recommended way of working.

> there doesn't seem to be an obvious way to achieve this
> goal. Is there a recipe for dealing with this scenario?

Use panels to dynamically build up the component. Basically, you
should break up the component in smaller parts - the parts that can
change - and make panels out of that. For example, look at
wicket.examples.template for such dynamic page composition. The
compref (component reference) example also has a piece about panels,
and while you're at it, check Fragments, Borders and markup
inheritence too. The sky is the limit with panels, like the nested
example shows where panels are even used recursively.


Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
Wicket-user mailing list

Reply via email to