找不到Primefaces标签rowSelectListener. [英] Primefaces tag rowSelectListener not found.
本文介绍了找不到Primefaces标签rowSelectListener.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面是我的JSF页面.
Below is my JSF page.
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Test page</title>
</h:head>
<h:body>
<p:dataTable var="order" value="#{orderBean.orderList}"
selection="#{orderBean.currentOrder}"
selectionMode="single">
<p:column>
#{order.customerId.name}
</p:column>
</p:dataTable>
</h:body>
</html>
我想将rowSelectListener添加到数据表中.但是,我的Netbeans IDE无法将此识别为p:dataTable的有效属性.此外,它似乎也没有编译.在侦听器中调用的方法未调用
I want to add a rowSelectListener to the datatable. However my Netbeans IDE does not recognize this as a valid attribute for p:dataTable. Furthermore, it also does not seem to compile. a method called in the listener is not called
rowSelectListener="#{orderBean.onRowSelect}"
我正在使用JSF 2.2(Mojarra 2.2.7)和Primefaces 5.0
I am working with JSF 2.2 (Mojarra 2.2.7) and Primefaces 5.0
推荐答案
这是因为素数数据表没有rowSelectionListener
.
It's because there is no rowSelectionListener
for primefaces datatable.
您必须像这样使用Ajax:
You have to use Ajax like this:
<p:ajax event="rowSelect" listener="#{dtSelectionView.onRowSelect}" update=":form:msgs" />
<p:ajax event="rowUnselect" listener="#{dtSelectionView.onRowUnselect}" update=":form:msgs" />
更多信息可用此处
这篇关于找不到Primefaces标签rowSelectListener.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文