In ListBox, how to you format first item Select... to italic and gray?

46 views
Skip to first unread message

Bob

unread,
Jun 30, 2011, 10:29:18 AM6/30/11
to google-we...@googlegroups.com
In ListBox, how to you format Select... to italic and gray?

GWT 2.3, still learning...
It is standard to have select visibile in the drop down box in italic and grayed out a bit.  I presume Select is simply the first item added.
   myrListBox.addItem("Select...");
with other "real " items after that added.

but I don't see how to format the word select.  You cannot attach at CSS to an added item (that I can see).

Any ideas?
Thanks!
Make it a great day!
bob

Eric Metcalf

unread,
Jun 30, 2011, 5:24:07 PM6/30/11
to google-we...@googlegroups.com
You will probably want to have 2 items here.  The "Select.." would be a clickable label with a background image of a downward arrow. The second would be your list adjacent under the first and hidden by default.  When a user clicks on the "Select..." label, you display the list.  When the user clicks a list item, hide the list and have the "Select..." change to the selected item.  This also means your submit button would have to verify that the user selected an item.

Reply all
Reply to author
Forward
0 new messages