Hi! If I understood correctly you want to change the color of <option>- Tags of a select- input (ListBox)!?
you can add a CSS- class: listBox.getElement().getElementsByTagName("option").getItem(<index>).setClassName(<your CSS- classname>) But in IE I habe a problem too... the color only changes, if the ListBox was drawing again on the screen after adding the class. -Danny 2009/2/20 Mani <many...@gmail.com> > > Hi, > > I have a list box which will populate values from database. Based on > certain conditions, I need to display each value in appropriate color. > How to change color of text? Here is piece of code that I have. > > userNameBox = new ListBox(false); > userNameBox.ensureDebugId("cwListBox-multiBox"); > userNameBox.setTitle("UNAME_BOX"); > userNameBox.setWidth("11em"); > userNameBox.setVisibleItemCount(10); > userNameBox.setStyleName(".gwt-ListBox1"); > > userNameBox.addItem(-- values from database--); > > Thanks > Mani > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---