Spring MVC 3.2.8 Application Not Binding Select Object With Form

I have an application based on Spring Web model-view-controller (MVC) framework. Using this approach in JSP, the value in the associated

<form:select path="deviceKey" id="deviceSelectId" onchange="javascript:newWindowLocationAssignDevice(this.value);" >
                                        <form:option value="all" label="ALL"/>
                                        <form:options items="${allDeviceList}" itemValue="name" />
                                    </form:select>

      

But using this approach, I always see the first option as selected regardless of the value of the form

<form:select path="deviceKey" id="deviceSelectId" onchange="javascript:newWindowLocationAssignDevice(this.value);" >
                                            <form:option value="all" label="ALL"/>
                                            <c:forEach items="${allDeviceList}" var="deviceVar">                                                                                                    
                                                            <c:choose>
                                                                <c:when test="${!(deviceVar.name eq 'AWARDED') && !(deviceVar.name eq 'DRAFT') && !(deviceVar.name eq 'CANCELLED') && !(deviceVar.name eq 'IN_PROGRESS') && !(deviceVar.name eq 'REFUSED')}" >                                                              
                                                                    <option value="${deviceVar.name}" >&nbsp;&nbsp;<fmt:message  key="${deviceVar.key}" /></option>
                                                                </c:when>
                                                                <c:otherwise>
                                                                    <option value="${deviceVar.name}"><fmt:message  key="${deviceVar.key}" /></option>
                                                                </c:otherwise>
                                                            </c:choose>                                                                                                                                                                         

                                                    </c:forEach> 
                                        </form:select>

      

+3
javascript spring html spring-mvc jsp


source to share


No one has answered this question yet

Check out similar questions:

1567
Converting form data to JavaScript object with jQuery
1262
What is the best way to add options to select from a JS object using jQuery?
708
How to configure port for Spring Boot application
407
HTML form readonly SELECT tag / input
351
What is @ModelAttribute in Spring MVC?
349
Binding select element to object in Angular
348
How to respond with HTTP 400 error in Spring MVC @ResponseBody method returning String?
237
Spring MVC @PathVariable with dot (.) Being truncated
1
i18n in select form (Spring MVC 3.2.8)
0
how to reset a dropdown box in a form created using spring tag



All Articles
Loading...
X
Show
Funny
Dev
Pics