When trying to edit the cell, method not found exception is thrown. I tried using an ajaxBehaviourEvent
, but it is throwing ClassCastException
: Sheet can not be cast to Sheet
//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();
}
Using PrimeFaces 6.2 and PrimeFacesExtension 6.2.3 and Seam 2.3