Re: is it possible to add a css class to FormComponent.setLabel()?

2014-08-01 Thread Stefan Renz
Hi,

lucast wrote:
> Dear Forum,
> Currently, I make heavy use of TextField.setLabel().
> If adding a css field to TextField is as easy as TextField.add(new
> AttributeAppender("class", " TestCSSClass ")); then:
> 
> How can I add a CSS class to  that has been created for TextField?

I don't think that TestField#setLabel has anything to do with markup
generation -- it won't generate a  tag. Instead, it is used for
validation messages "...${label}..." (see javadoc).

Just use regular HTML in your markup file:
Your Textfield


The wicket:message stuff is Wicket's I18N and not strictly required.
However, using it, you can use a StringResourceModel as the argument to
setLabel to get the same property value, so your label in the
markup/HTML corresponds to the label displayed in validation error messages.

> 
> Thanks in advance,
> Lucas

Hope this helps, bye,
Stefan
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/is-it-possible-to-add-a-css-class-to-FormComponent-setLabel-tp4666801.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 

-- 
im Auftrag der eFonds Solutions AG, +49-89-579494-3417


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



is it possible to add a css class to FormComponent.setLabel()?

2014-07-30 Thread lucast
Dear Forum,
Currently, I make heavy use of TextField.setLabel().
If adding a css field to TextField is as easy as TextField.add(new
AttributeAppender("class", " TestCSSClass ")); then:

How can I add a CSS class to  that has been created for TextField?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/is-it-possible-to-add-a-css-class-to-FormComponent-setLabel-tp4666801.html
Sent from the Users forum mailing list archive at Nabble.com.

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