Hi,
I am new to using the JSF components and GridView. I was able to get cell editing to work by specifying cellValueChangeListener in the ig:GridView tag but I would like the grid to refresh after the cellValueChangeListener has fired and I have updated the database. I have tried setting the binding to a grid in the backing bean and doing a grid.dataBind(), but this doesn't seem to work.
Are there any samples or information on how to refresh the grid after an update?
Thanks
Nathan
Yes! Please check out the online demos at componentsforjsf.com. There are several that deal with this specific issue.
Thanks!
Thanks,
The refresh works fine if I update a record in the first 50 rows. But I have set the rowFetchSize to 50 on this grid and loadOnDemand="default" so that when the get to the bottom of the first 50 records it loads the next 50. Then if I try to edit a cell in the next 50 rows it throws this error.
executePhase(UPDATE_MODEL_VALUES 4,com.sun.faces.context.FacesContextImpl@305242) threw exceptionjava.lang.IndexOutOfBoundsException: Index: 52, Size: 50
What am I doing wrong?
Thanks - Nathan
Hello Nathan,
You can refresh the grid by smart refresh manager in your cellValueChange event handler. Following is the code snippets for your reference:
public void cellValueChangeListener(CellValueChangeEvent evnt){
..
SmartRefreshManager.getCurrentInstance().addSmartRefreshId(grid.getClientId(FacesContext.getCurrentInstance()));
grid.dataBind();
}
Thank you.