【发布时间】:2016-08-06 18:09:38
【问题描述】:
我的视图中有此代码,但在选择任何行时我无法调用侦听器方法。每个事件都指向一个仅在控制台中打印文本的方法,因此我确保它有效,但它没有。我想知道我是否遗漏了什么?
<p:panelGrid columns="2">
<p:column>
<h:form id="formSelectEmployee">
<p:dataTable
id="employeeDataTable"
var="employee"
value="#{employeeController.employeeList}"
selectionMode="single"
selection="#{employeeController.selectedEmployee}"
rowKey="#{employee.id}">
<p:ajax event="rowSelect" listener="#{employeeController.selectEmployee}" update=":tabs" />
<p:ajax event="rowUnselect" listener="#{employeeController.unSelectEmployee}" update=":tabs" />
<p:column>
<h:outputText value="#{employee.fullName}" />
</p:column>
</p:dataTable>
</h:form>
</p:column>
</p:panelGrid>
【问题讨论】:
-
我将它包含在问题中,因为它就是我拥有它的方式。无论如何,它是否在面板网格内/外都没有关系,该项目没有被选中并且我没有收到错误消息。
标签: jsf primefaces datatable selection