You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Uvex <an...@gmail.com> on 2012/03/08 21:58:28 UTC

Best practice for adding style to a component

I am new in wicket and programming and I'll be grateful if someone could tell
me what is the best practice for adding css style to a component (or setting
a css class): from the .java file or from the .html file?


OR 
control.add(new SimpleAttributeModifier("class", "HelloCssClass"));

Thank you.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Best-practice-for-adding-style-to-a-component-tp4457648p4457648.html
Sent from the Users forum 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: Best practice for adding style to a component

Posted by Igor Vaynberg <ig...@gmail.com>.
html is best for static classes

for java subclass the component and override oncomponenttag and set
the class from there.

if you cannot do that or you have some cross-component-cutting logic
then use an attribute modifier.

-igor


On Thu, Mar 8, 2012 at 12:58 PM, Uvex <an...@gmail.com> wrote:
> I am new in wicket and programming and I'll be grateful if someone could tell
> me what is the best practice for adding css style to a component (or setting
> a css class): from the .java file or from the .html file?
>
>
> OR
> control.add(new SimpleAttributeModifier("class", "HelloCssClass"));
>
> Thank you.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Best-practice-for-adding-style-to-a-component-tp4457648p4457648.html
> Sent from the Users forum 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