thank you, this was a wrong copy/paste, it should be name instead.
The scenario is the user select an item from the drop down list, then submit the form. what I get is that drug.id is set to the selected value, but I also want drug.name to be set to the selected label, is that possible?
Main Topics
Browse All Topics





by: objectsPosted on 2009-10-27 at 23:40:10ID: 25680437
> but I also want to set drug.name property to the selected label (itemLabel).
then your options tag should be:
<form:options items="${drugs}" itemLabel="name" itemValue="id"/>