You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mike Duffy <md...@yahoo.com> on 2006/02/18 06:19:43 UTC

Adding Image Icons to Drop Down Lists

There is a cool technique to add image icons to drop-down lists:

<option id="issuetype" value="1" style="background-image: url(/images/icons/someIcon.gif);"
   selected="selected">Some Label</option>

Is there anyway to do this with SelectItems in JSF?

Thx.

Mike

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Adding Image Icons to Drop Down Lists

Posted by Mike Duffy <md...@yahoo.com>.
I should have been more clear.  I am using a collection of SelctItems with the <f:selectItems.../>
tag.  I think it will be necessary to specify the style through each SelectItem object.

Mike

--- Andrew Robinson <an...@gmail.com> wrote:

> Lol, good point, been working too hard I guess...
> 
> On 2/18/06, Laurie Harper <la...@holoweb.net> wrote:
> > Why bother? Just do
> >
> >   <f:selectItem ... style="background-image:
> > url(/images/icons/someIcon.gif);"/>
> >
> > L.
> >
> > Andrew Robinson wrote:
> > > You could build your own custom renderer to do this.
> > >
> > > On 2/17/06, Mike Duffy <md...@yahoo.com> wrote:
> > >> There is a cool technique to add image icons to drop-down lists:
> > >>
> > >> <option id="issuetype" value="1" style="background-image: url(/images/icons/someIcon.gif);"
> > >>    selected="selected">Some Label</option>
> > >>
> > >> Is there anyway to do this with SelectItems in JSF?
> > >>
> > >> Thx.
> > >>
> > >> Mike
> > >>
> > >> __________________________________________________
> > >> Do You Yahoo!?
> > >> Tired of spam?  Yahoo! Mail has the best spam protection around
> > >> http://mail.yahoo.com
> > >>
> > >
> >
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Adding Image Icons to Drop Down Lists

Posted by Andrew Robinson <an...@gmail.com>.
Lol, good point, been working too hard I guess...

On 2/18/06, Laurie Harper <la...@holoweb.net> wrote:
> Why bother? Just do
>
>   <f:selectItem ... style="background-image:
> url(/images/icons/someIcon.gif);"/>
>
> L.
>
> Andrew Robinson wrote:
> > You could build your own custom renderer to do this.
> >
> > On 2/17/06, Mike Duffy <md...@yahoo.com> wrote:
> >> There is a cool technique to add image icons to drop-down lists:
> >>
> >> <option id="issuetype" value="1" style="background-image: url(/images/icons/someIcon.gif);"
> >>    selected="selected">Some Label</option>
> >>
> >> Is there anyway to do this with SelectItems in JSF?
> >>
> >> Thx.
> >>
> >> Mike
> >>
> >> __________________________________________________
> >> Do You Yahoo!?
> >> Tired of spam?  Yahoo! Mail has the best spam protection around
> >> http://mail.yahoo.com
> >>
> >
>
>

Re: Adding Image Icons to Drop Down Lists

Posted by Laurie Harper <la...@holoweb.net>.
Why bother? Just do

  <f:selectItem ... style="background-image: 
url(/images/icons/someIcon.gif);"/>

L.

Andrew Robinson wrote:
> You could build your own custom renderer to do this.
> 
> On 2/17/06, Mike Duffy <md...@yahoo.com> wrote:
>> There is a cool technique to add image icons to drop-down lists:
>>
>> <option id="issuetype" value="1" style="background-image: url(/images/icons/someIcon.gif);"
>>    selected="selected">Some Label</option>
>>
>> Is there anyway to do this with SelectItems in JSF?
>>
>> Thx.
>>
>> Mike
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam?  Yahoo! Mail has the best spam protection around
>> http://mail.yahoo.com
>>
> 


Re: Adding Image Icons to Drop Down Lists

Posted by Andrew Robinson <an...@gmail.com>.
You could build your own custom renderer to do this.

On 2/17/06, Mike Duffy <md...@yahoo.com> wrote:
> There is a cool technique to add image icons to drop-down lists:
>
> <option id="issuetype" value="1" style="background-image: url(/images/icons/someIcon.gif);"
>    selected="selected">Some Label</option>
>
> Is there anyway to do this with SelectItems in JSF?
>
> Thx.
>
> Mike
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>