尝试编辑单元格时,抛出方法未找到异常。我尝试使用ajaxBehaviourEvent
,但它正在抛出ClassCastException
:无法将工作表强制转换为工作表
//view
<p:ajax listener="#{dataListView.cellEditEvent}" process=":form:sheet" update=":form:sheet" >
</p:ajax>
// method
public void cellEditEvent(SheetEvent event) {
org.primefaces.extensions.component.sheet.Sheet sheet = event.getSheet();
List<SheetUpdate> updates = sheet.getUpdates();
HashSet<Sample> processed = new HashSet<Sample>();
int rowUpdates = 0;
for (SheetUpdate update : updates) {
Sample asset = (Sample) update.getRowData();
if (processed.contains(asset))
continue;
entityManager.merge(asset);
System.out.println("Asset " + asset.getEmail() + " updated.");
rowUpdates++;
showSampleData();
}
sheet.commitUpdates();
}
使用PrimeFaces 6.2和PrimeFacesExtension 6.2.3和Seam 2.3