Hello,
is there anyway to pre select an item in a ig:dropDownList?
maybe I am just stupid, but I couldn't find anything.
cheers
/anja
Hello Anja,
You can use the Value attribute of ig:dropDownList tag to preselect a value. Make sure there exist a value as a "SelectItem" within the DropDownList's datasource, so that the right value is selected.
-Taz.
I have similar problem about dropDownList.
My dropDownList has value binding to a field in a backing bean. If field is not null everything works fine and appropriate row is selected from list. But when field value is null - first row from dropDownList is selected what is of course misleading. To fix this I tried to add empty element to dropDownList:
new SelectItem(null,null)
...but unfortunately it causes an exception:
Exception while calling encodeEnd on component :Caused by: java.lang.NullPointerException - Exception while calling encodeBegin on component [Class: com.infragistics.faces.input.component.html.HtmlDropDownList]
Any idea how to cope with this problem?