[英]How To highlight the multiselect box selected item on editing
<select name="projecttype" class="selt-box" onfocus="window.dropdown_menu_hack(this)">
<c:forEach items="${lookupdetails}" var="lookupdetails" >
<c:if test="${not empty lookupdetails.lookupName && lookupdetails.lookupId==16}"> <option value="${lookupdetails.lookupdetailId}">${lookupdetails.lookupName}</option>
</c:if>
</c:forEach>
</select>
上面的代碼是一個多選框。 請告訴我如何使選定的值突出顯示..在編輯時..我從控制器使用了value = ${xx}
,這是選定的值..它不起作用..pl幫助
可以使用spring的form:select標記將其存檔。 看一看可以覆蓋您的場景的代碼片段。
<form:select path="lookupdetails" multiple="true">
<form:options items="${lookupdetails}" itemLabel="lookupName" itemValue="lookupId" />
</form:select>
Spring將生成為lookupDetails集中的對象預先選擇的html。
問候,Hemanth
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.