JSF:具有f:attribute的p:dataTable导致“参数类型不匹配".错误 [英] JSF: p:dataTable with f:attribute results in "argument type mismatch" error
本文介绍了JSF:具有f:attribute的p:dataTable导致“参数类型不匹配".错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想向p:dataTable
添加有条件的参数,如 pastebin上的堆栈跟踪).
I want to add conditionally add some arguments to a p:dataTable
like described in Conditionally render element's attribute in a composite component. But even without the c:if
I get an 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.
The error does not occur (and the paginator is available) if I add the attribute directly <p:dataTable ... paginator="true">
.
My environment is Primefaces 3.4.1 with JBoss 7.1.1-Final.
推荐答案
尝试将其作为EL对象传递:
Try passing it as EL object:
<f:attribute name="paginator" value="#{true}" />
这篇关于JSF:具有f:attribute的p:dataTable导致“参数类型不匹配".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文