簡體   English   中英

Thymeleaf在其他標簽中使用對象

[英]Thymeleaf use Objects in other tags

調用頁面時,select從數據庫中獲取選項。

看起來像這樣:

<select id="facilityList" th:field="${list}">
        <option th:value="def">Bitte wählen Sie eine Einrichtung aus</option>
        <option th:each="item : ${list}" th:text="${item.name}" th:value="${item.name}"></option>
    </select>

現在,我要根據下拉列表中選擇的項目,以不同​​的跨度顯示相應的對象信息。 像這樣:

<span >name of item</span>

項目地址

做這個的最好方式是什么?

調用頁面時,select從數據庫中獲取選項。

看起來像這樣:

<select id="facilityList" th:field="${list}">
        <option th:value="def">Bitte wählen Sie eine Einrichtung aus</option>
        <option th:each="item : ${list}" th:text="${item.name}" th:value="${item.name}"></option>
    </select>

現在,我要根據下拉列表中選擇的項目,以不同​​的跨度顯示相應的對象信息。 像這樣:

<span >name of item</span>

項目地址

做這個的最好方式是什么?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM