在我的問題中,我必須根據條件顯示h:panelGroup
。對於此h:panelGroup
,rendered
屬性已被設置。如何根據條件顯示h:panelGroup
<h:panelGroup rendered="#{not empty program.categories}">
<li>
<strong>Category: </strong>
<h:outputLabel value="#{not empty program.categories ? 'A':'N/A'}"/>
</li>
</h:panelGroup>
我現在想保持狀態像下面的代碼:
<c:if test="${program.distTypeName != 'X' || program.distTypeName != 'Y' || program.distTypeName != 'Z'}">
<h:panelGroup rendered="#{not empty program.categories}">
<li>
<strong>Category: </strong>
<h:outputLabel value="#{not empty program.categories ? 'A':'N/A'}" />
</li>
</h:panelGroup>
,但是這是行不通的。請告訴我我做錯了什麼。基本上,如果disType
不在x,y,z中,那麼我需要顯示h:panelGroup
。
我們如何用jstl標籤測試not in
條件? 在此先感謝。
此[鏈接](http://stackoverflow.com/questions/4870462/conditionally-displaying-jsf-components/4870557#4870557)將幫助您。 – danRod
但我怎麼可以在我的情況下使用呈現的atrribute ..不工作..我應該檢查條件只爲這個h:panelGroup..not爲整個表單。請建議。 –
sahithi
在'''rendered'屬性內移動''條件 –
Andy