问题描述
|
这个问题已经在这里有了答案:
解决方法
在这里,你去火影忍者...
首先,您需要使用具有id的对象填充表
比在表中添加一个“删除”列
<p:column headerText=\"Delete\">
<p:commandLink ajax=\"true\" action=\"#{hoursReportBean.removeEntity}\" update=\"@form\" process=\"@this\" styleClass=\"ui-icon ui-icon-trash\">
<f:setPropertyActionListener
target=\"#{hoursReportBean.selectedHourReportsToDeleteFromTable}\"
value=\"#{hourReport}\" />
</p:commandLink>
</p:column>
public String removeEntity(){
...
use the id of the object selectedHourReportsToDeleteFromTable.getId() in order to delete it from the list
...
}
拉森甘