Warm tip: This article is reproduced from stackoverflow.com, please click
frontend html spring drop-down-menu

Drop-down menu options assigned but not visible?

发布于 2020-04-07 10:19:48

I can't really understand what I'm doing wrong..
I have a drop-down menu and I want to iterate over a list of elements.
The list is read correctly and when I run the application I can even see the right options for the menu listed using "Inspect Element" from Firefox Browser...but why can't I access the selection rectangle? And it doesn't show anything. When I click on it, it's not possible to choose anything.

this is the code for the selection in the jsp:

<form:select path="list" class="selectpicker" multiple="true" data-max-options="4">
               <form:options items="${av_list}"/>
</form:select>

Where list is the object that has to be "filled" with the selection. Any help is appreciated.

enter image description here

Questioner
Chiara S
Viewed
15
Rob Moll 2020-02-01 01:46
<form:options items="${av_list}"/>

The template literal should be surrounded by backticks instead of quotes. Like this:

<form:options items=`${av_list}`/>

I wish I could tell you exactly why that causes the symptom you were seeing, but I cannot. Maybe someone brighter than me can comment regarding that.