Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dropdown menu "Conversion Error setting value '' for 'null Converter'" [duplicate]

So i am using seam to try to make a dropdown menu to add a delivery to a database. I'm using a drop down menu to select which employee from the database is doing the delivery. The menu loads all the employees in the database just fine but when I select one and click add, I get the error "Conversion Error setting value '(hash for employee)' for 'null Converter'.

here's the code for the dropdown menu:

<my:dropdown label="Employee ID" id="emp" value="#{deliveryPort.emp}" required="false">
                    <f:selectItem itemValue="#{null}" itemLabel="Selct One"/>
                    <s:selectItems value="#{deliveryPort.empList}" var="emp" label="#   {emp.employeeId} #{ emp.nameFirst}"/> 
               </my:dropdown>

Any help would be greatly appreciated. Thank you

like image 664
user1423793 Avatar asked Jun 01 '12 13:06

user1423793


1 Answers

You should do 2 things to avoid this error:

  1. Make sure your class emp is implementing equals() and hashCode()
  2. Use an converter to convert your selected value before passing it to the backing bean

BalusC wrote a nice tutorial about converters and how to use them.

like image 94
flash Avatar answered Nov 13 '22 22:11

flash