Hi,
In your form controller, simply override the method Map
referenceData(HttpServletRequest request, Object command,
Errors errors);
i.e:
protected Map referenceData(HttpServletRequest request, Object command,
Errors errors) throws Exception {
Map referenceData = new HashMap();
referenceData.put("teamList", teamManager.getAll());
//add other data you might need
return referenceData;
}
make sure to inject your teamManager into your controller.
that s it.
Charles
On 24 May 2010, at 15:00, Tuppence wrote:
Hello,
Help please, I'm a newBie in Appfuse (so great !, thanks a lot) and
SpringMVC.
I have 2 entities with a ManyToOne relation.
In the edit view of the first entity, I would like a listbox with all
possible values of the 2nd entity with a Select tag:
<form:select path="team" id="team">
<form:option value="-">Choose one</form:option>
<form:options items="${teamList}" itemValue="id"
itemLabel="name"></form:options >
</form:select>
What and where to do in the formController to expose all my teamList
values
in the model ?
Do I have to create a getTeamList() method ? How to do the mapping ?
Thanks
--
View this message in context:
http://appfuse.547863.n4.nabble.com/How-to-populate-a-list-box-with-SpringMVC-tp2228530p2228530.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net