You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Philip Wilkinson <wi...@gmail.com> on 2012/01/15 23:25:09 UTC

Can I modify the style of an option tag?

Hi,

I'm looking to implement something like

http://technology.amis.nl/blog/994/html-select-item-with-icons-in-addition-to-just-text-labels-applying-the-css-background-style-to-the-html-option-element

to add icons to the drop-down selection list.

but I notice that I cant use an AttributeAppender on the options as
they are rendered as part of the select component in
AbstractChoice.appendOptionHtml

should I be overriding this AbstractChoice.appendOptionHtml or is
there a better way?

Regards

Phil.

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


Re: Can I modify the style of an option tag?

Posted by malebu <mi...@gmail.com>.
Refer
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/extensions/markup/html/form/select/Select.html

then add the following code:


option.add(AttributeModifier.replace("style","background-image:
url(/images/icons/bug.gif)"));

thats should do the trick
-Milton

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-I-modify-the-style-of-an-option-tag-tp4297927p4298256.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