I replaced rich:pickList to selectManyListbox for testing, when submit values to server it still displays error: "Validation Error: Value is not valid". I also set breakpoint to debug StaffConverter (getAsobject), but system never invokes it. Pls let me know some reasons why my converter never invoked and suggest me how to fix this. thanks

xhtml file:

```
<h:selectManyListbox value="#{reportController.selectedStaffList}" converter="staffConverter">
   <f:selectItems value="#{reportController.staffList}" 
                  var="item" itemValue="#{item}" itemLabel="#{item.name}" />
</h:selectManyListbox>

<rich:pickList value="#{reportController.selectedStaffList}" converter="staffConverter" sourceCaption="Available flight" targetCaption="Selected flight" listWidth="195px" listHeight="100px" orderable="true">
   <f:selectItems value="#{reportController.staffList}" var="item" itemValue="#{item}" itemLabel="#{item.name}" />
</rich:pickList>

```

My Converter:

```
@FacesConverter(forClass = Staff.class)
public static class StaffConverter implements Converter {

    public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
        if (value == null || value.length() == 0) {
            return null;
        }
        StaffController controller = StaffController.getInstance();
        return controller.facade.find(Staff.class, getKey(value));
    }

    java.lang.Integer getKey(String value) {
        java.lang.Integer key;
        key = Integer.valueOf(value);
        return key;
    }

    String getStringKey(java.lang.Integer value) {
        StringBuffer sb = new StringBuffer();
        sb.append(value);
        return sb.toString();
    }

    public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
        if (object == null) {
            return null;
        }
        if (object instanceof Staff) {
            Staff o = (Staff) object;
            return getStringKey(o.getStaffCode());
        } else {
            throw new IllegalArgumentException("object " + object + " is of type " + object.getClass().getName()
                    + "; expected type: " + StaffController.class.getName());
        }
    }
}

```

I implemented equals method in Staff:

```
@Override
public boolean equals(Object object) {
    if (!(object instanceof Staff)) {
        return false;
    }
    Staff other = (Staff) object;
    return (this.staffCode == other.staffCode);
}

```