根据从百里香中的下拉列表中选择的值迭代列表

时间:2019-02-21 12:47:19

标签: java html spring spring-boot thymeleaf

我是百里香的新手。我有一个名为EndpointCluster的列表,其中包含String团队和List端点。 在视图中,我在视图中有2个下拉菜单。一个是给团队的。另一个是端点。现在,我希望根据我们为团队选择的值来加载端点列表。

这是我写的。

<tbody>
   <tr>
      <td>Team</td>
      <td>
         <select id="teamDropdown" required="required" name="team">
            <option th:each="emp: ${endpointsCluster}" th:value="${emp.team}"
               th:text="${emp.team}"></option>
         </select>
      </td>
   </tr>
   <tr>
      <td width="25%">Endpoint Name:</td>
      <td>
         <select id="endppointDropdown" required="required" name="inputJson">
            <option  th:each="endp: ${endpointsCluster[1].endpoints}" th:value="${endp.name}"
               th:text="${endp.name}"></option>
         </select>
      </td>
   </tr>
</tbody>

在“端点”下拉列表中,我正在获取endpointsCluster列表中第二个元素的端点列表。 我希望它根据团队价值动态加载端点。

0 个答案:

没有答案