Java Spring Thymeleaf下拉列表已禁用并显示
我有:Java Spring Thymeleaf下拉列表已禁用并显示,java,spring,thymeleaf,Java,Spring,Thymeleaf,我有: 没有一个 对 如果没有userProfile权限,我想禁用此选择 问题是:如果我有disabled属性,下拉列表不会出现。 如果删除了禁用属性,则会出现下拉列表 我可以禁用该功能并同时显示下拉列表吗 谢谢。th:除非使整个标签消失。相反,使用th:disabled并使用Thymeleaf设置条件 <select th:unless="${#strings.contains(session.userProfile.permission, 'UPDATE_GENERAL')}" d
没有一个
对
如果没有userProfile权限,我想禁用此选择
问题是:如果我有disabled属性,下拉列表不会出现。
如果删除了禁用属性,则会出现下拉列表
我可以禁用该功能并同时显示下拉列表吗
谢谢。
th:除非
使整个标签消失。相反,使用th:disabled
并使用Thymeleaf设置条件
<select th:unless="${#strings.contains(session.userProfile.permission, 'UPDATE_GENERAL')}" disabled="disabled" id="kt_select2_10" name="sbSmtpSecurity">
<option th:value="false">None</option>
<option th:value="true" th:selected="${systemSetting.sbSmtpSecurity}">Yes</option>
</select>
没有一个
对
th:除非
使整个标记消失。相反,使用th:disabled
并使用Thymeleaf设置条件
<select th:unless="${#strings.contains(session.userProfile.permission, 'UPDATE_GENERAL')}" disabled="disabled" id="kt_select2_10" name="sbSmtpSecurity">
<option th:value="false">None</option>
<option th:value="true" th:selected="${systemSetting.sbSmtpSecurity}">Yes</option>
</select>
没有一个
对