I have problem to let user know about exceptions occurred in PrimeFaces LazyDataModel#load
method.
I am loading there data from database and when an exception is raised, I have no idea how to inform the user about it.
I tried to add FacesMessage
to FacesContext
, but message is not shown on the Growl component, even if Growl is set to autoUpdate="true"
.
Using PrimeFaces 3.3.
It doesn't work because
load()
method is invoked during Render Response phase (you can check this by printingFacesContext.getCurrentInstance().getCurrentPhaseId()
), when all messages have already been processed.The only workaround that worked for me is to load the data within the "page" event listener of the DataTable.
html:
Controller:
Hope this helps.