我想有条件地向 p:dataTable
添加一些参数如 Conditionally render element's attribute in a composite component 中所述.但即使没有 c:if
我得到一个 java.lang.IllegalArgumentException: argument type mismatch
(Stacktrace on pastebin)。
...
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
...
<p:dataTable var="r" value="#{myBean.values}" >
<f:attribute name="paginator" value="true" />
</p:dataTable>
如果我直接添加属性,则不会出现错误(并且分页器可用)<p:dataTable ... paginator="true">
.
我的环境是带有 JBoss 7.1.1-Final 的 Primefaces 3.4.1。
最佳答案
尝试将其作为 EL 对象传递:
<f:attribute name="paginator" value="#{true}" />
关于java - JSF: p:dataTable with f:attribute 导致 "argument type mismatch"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13006322/