12
我想作一個OR條件在此菜單:EL表達式中的OR條件如何?
<li class="#{facesContext.viewRoot.viewId == ('/company/team.xhtml' or '/company/partnerships.xhtml') ? 'active' : '' }"><a class="item" href="company/company.xhtml">Company</a>
<ul>
<li><a href="company/team.xhtml">Team</a></li>
<li><a href="company/partnerships.xhtml">Partnerships</a></li>
</ul>
</li>
,如果team.xthml
或partnerships.xhtml
頁面由用戶選擇的「活躍」值將在<li>
標籤來設置它。
謝謝鮑克,我沒有不知道我可以縮短,謝謝你的朋友。 –
不客氣。 – BalusC