2
類似於here我使用抽象類來鍵入項目集列表 的ui:重複。具體子類覆蓋對GetType()方法,其用於 有條件地呈現其特定性質的各亞型:有條件地呈現JSF中的子類ui:重複標記
<!-- AbstractAction Rule#getActions() -->
<ui:repeat value="#{rule.actions}" var="action">
<!-- render when "action" instance of NotificationAction -->
<h:panelGroup rendered="#{action.type == 'notification'}">
... UI for NotificationAction properties
<h:panelGroup rendered="#{action.type == 'callback'}">
...
當在Glassfish 3運行有關於未在列表中的 成員定義的屬性的錯誤其他亞類(PropertyNotFoundException),其發生在 實際上由渲染屬性關閉一個分支。 C:的forEach/C:選擇似乎並不 合適。任何想法如何使渲染真正有條件並繞過 屬性檢查高度讚賞!
謝謝。 哈羅
重複的http://stackoverflow.com/questions/22613193/javax-el-propertynotfoundexception-when-submitting-uirepeat-with-conditionally/ – BalusC 2014-08-12 18:38:35