Hi,

I want to add a drop down list of user in a page (Spring MVC) :

so I implement the referenceData of my FormController :

@Override
@SuppressWarnings("unchecked")
protected Map referenceData(HttpServletRequest request) throws Exception {
 log.debug("entering 'refenceData' function ..." );
 // return super.referenceData(request);
 Map model = new HashMap();
 List<User> directeurs = getUserManager().getUsers(new User());
 model.put( "directeurs", directeurs );
 return model;
}

in my jsp :

<form:select path="directeur" itemValue="id" itemLabel="lastName" items="${directeurs}" ></form:select>

the data appears correctly on my page but when I save my form I've got an error ( a other one;-) ) :

-----------------------
Failed to convert property value of type [java.lang.String] to required type [org.appfuse.model.User] for property directeur; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.appfuse.model.User] for property directeur: no matching editors or conversion strategy found
-----------------------

I don't know how to correct the problem ( where and how do I make the conversion ).
I have 2 small other questions :
- Is it possible to show in the list a label like surname + lastname ?
- I have seen a <s:select tag in my generated controller which come from Struts (I think). Is there a reason . better than Spring select tag ?

Thank you. Julien C.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to