Combobox without empty content

  1. Normally when we are creating a combobox an empty content will be ther at the 0-th index… How it can be removed…
  2. I need to show as “Select An Item” as 0th content (Not like input prompt)
    how can i make that

Call setNullSelectionAllowed(false) on the ComboBox. You can also pre-select the first item by calling setValue() with the item id of the first item as the parameter.

Add a separate null selection item to the ComboBox (or the container you’re using with it) and set it as the null item by using the setNullSelectionItemId(Object nullSelectionItemId) method.


dear Tepi ,

it worked … excellent …
setNullSelectionItemId(Object nullSelectionItemId)
the above method didnt helped… but no problem we resoleved it by adding a Key Value Pair at the begining and called the setValue() method.