title: Thymeleaf: disabling a component
body: <p>I have a basic SpringBoot 2.0.5.RELEASE app. Using Spring Initializer, JPA, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file. I have this template, where I want to disable a select object based on a condition</p>
  
  <pre><code>&lt;form id="menuFormId" class="form-style-9" action="#" th:action="@{/menu/save}" th:object="${menu}" method="post"&gt;
      &lt;ul&gt;
          &lt;li th:each="e : ${#fields.detailedErrors()}" th:class="${e.global}? globalerr : fielderr"&gt;
              &lt;span th:text="${e.global}? '*' : ${e.fieldName}" &gt;&lt;b&gt;The field name&lt;/b&gt;&lt;/span&gt; : &lt;span th:text="${e.message}" class="red"&gt;
                  &lt;font color="red"&gt;The error message&lt;/font&gt;
              &lt;/span&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
      &lt;ul class="tab_form"&gt;
          &lt;li&gt;        
              &lt;select id="selectMenuId" th:field="*{resto}" th:classappend="${menu.id == null} ?  disabled='disabled'"&gt;
                  &lt;option value="0"&gt;PLEASE SELECT A MENU&lt;/option&gt;
              &lt;/select&gt;
  ...
  </code></pre>
  
  <p>But I got this error:</p>
  
  <pre><code>Could not parse as expression: "${menu.id == null} ?  disabled='disabled'"
  </code></pre>