0

My question is related to this.

I have the following:

<div class="container">
<div class="wrapper">
<div class="arrow-steps clearfix">
<div th:each="caseStep : ${getAppCaseStepList}"
                                        th:class="arbitrary"
                                        th:classappend="${caseStep.casestepname == '${appCaseCurrentStep}'} ? 'step current' : 'step'"
                                        th:text="${caseStep.casestepname}">
</div>
</div>
</div>
</div>

where ${appCaseCurrentStep} is a model attribute (a String) which I am sending through GET in my controller method.

But somehow I am not able to set "step current" class to the element for this condition:

${caseStep.casestepname == '${appCaseCurrentStep}'

I am trying to set/append "step current" where my condition is true (String comparison) . What am I missing here or doing wrong?

Ajay Kumar
  • 2,906
  • 3
  • 23
  • 46

1 Answers1

0

Found it here. !

The cause: There should NOT be an additional { inside the expression ${...}.

Solution: The following expression did the trick for me:

<div th:each="caseStep : ${getAppCaseStepList}"
                                        th:class="asdfstep"
                                        th:classappend="${caseStep.casestepname == appCaseCurrentStep} ? 'step current' : 'step'"
                                        th:text="${caseStep.casestepname}"></div>
Ajay Kumar
  • 2,906
  • 3
  • 23
  • 46