views:

617

answers:

1

I'm developing a spring application, now I've added a dropdownlist to one of my jsp pages using:

<form:select multiple="single" path="users[y.count-1].X" items="${Y}" itemValue="id" itemLabel="name"/>

Now I'd like to add the default value "Nothing selected", however I can't seem to find how to do this. I've tried:

<form:select multiple="single" path="users[y.count-1].X" items="${Y}" itemValue="id" itemLabel="name">
   <form:option value="Nothing selected" />
</form:select>

But "Nothing selected" isn't displayed in my dropdownlist.

A: 

You should be able to do

<form:select multiple="single" path="users[y.count-1].X" >
   <form:option value="Nothing selected" />
   <form:options items="items="${Y}"  itemValue="id" itemLabel="name" />
</form:select>
JacobM
Doh, can't believe I overlooked that one.Thank you.
Mike