javax.el.PropertyNotFoundException when submitting ui:repeat with conditionally rendered properties of different subclasses

穿精又带淫゛_ 提交于 2019-11-28 09:31:48

This is caused by a bug in state management of Mojarra's <ui:repeat> which is fixed as per issue 3215 as reported by my fellow Arjan Tijms. We also faced this problem when iterating over different Block instances at zeef.com (LinkBlock, ImageBlock, TextBlock and FeedBlock). The fix is available in Mojarra 2.2.7 and for JSF 2.0/2.1 backported to Mojarra 2.1.29 as per issue 3221. So upgrading to at least that version (or just the latest available as per Mojarra homepage) should do it.

Otherwise, your best bet is to replace <ui:repeat> by <c:forEach>.

In my case I didn't had the option to upgrade Mojarra's version and to avoid c:forEach (that causes many side-effects when used with ui optionally rendered components) I replaced ui:repeat with a p:dataList and it worked. You'll have to do some CSS styling to hide the bullets but I think it's worth the price. I hope it helps someone ;)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!