droidlulz
droidlulz

Reputation: 53

spring form composed item value of a drop down list

is it possible to display a composed (concat) item label of a spring dropdown list form ?

something like :

<form:select path="project"  id="role" >
<form:options items="${projectList}" itemValue="projectID" itemLabel="startDate +'To'+ endDate"/>
</form:select>

thanks.

Upvotes: 1

Views: 1431

Answers (2)

user1445891
user1445891

Reputation: 1

Binding for the dropdown doesnt work after when returning back to the same form after a submit action. Selected values are not getting displayed back on the form.

Upvotes: 0

Japan Trivedi
Japan Trivedi

Reputation: 4483

As per my understanding its not possible. But you should set the itemLabel property in that way from your controller itself if you need it like that in the jsp.

Or you can also go for <c:forEach/> and inside that you can create the options with pure html tag and in case of label you can combine both the properties there like you have tried to do in your question.

Hope this helps you. Cheers.

Upvotes: 2

Related Questions