I am trying to emulate the Primefaces Showcase to have a result set that uses filtering and a row expansion. I get errors whenever I try either one. The page loads without errors. In the code example, I have stripped the filtering to isolate the issue. It appears that any time an AJAX request is triggered it will give an error. The error is triggered when trying to use the row expansion as that uses an AJAX call to fetch the expanded row.
We are using Primefaces 8.0 on IBM Rad local server (Eclipse). Result set is pulled from DB2 using Hibernate and that part works.
Please help by suggesting why the AJAX fails everytime?
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> </h:head> <h:body> <ui:composition template="/template/maintemplate.xhtml"> <ui:define name="title">Search Results</ui:define> <ui:define name="content"> <h:form id="formId"> #{searchResultsBean.init} <p:dataTable id="parameterList" var="data" value="#{searchResultsBean.parameterList}"> <p:column style="width:16px"> <p:rowToggler /> </p:column> <p:column value="#{data.companyId}" > <f:facet name="header"> <h:outputText value="Company ID" /> </f:facet> <h:outputText value="#{data.companyId}" /> </p:column> <p:column value="#{data.companyName}" > <f:facet name="header"> <h:outputText value="Company Name" /> </f:facet> <h:outputText value="#{data.companyName}" /> </p:column> <p:column value="#{data.alertNumber}"> <f:facet name="header"> <h:outputText value="Alert Number" /> </f:facet> <h:outputText value="#{data.alertNumber}" /> </p:column> <p:column value="#{data.comment}"> <f:facet name="header"> <h:outputText value="Comment" /> </f:facet> <h:outputText value="#{data.comment}" /> </p:column> <p:rowExpansion> <p:panelGrid columns="2" columnClasses="label,value" style="width:300px"> <h:outputText value="Company ID" /> <h:outputText value="#{data.companyId}" /> <h:outputText value="Company Name" /> <h:outputText value="#{data.companyName}" /> <h:outputText value="Alert #" /> <h:outputText value="#{data.alertNumber}" /> <h:outputText value="Alert Description" /> <h:outputText value="$#{data.alertNumber}" /> </p:panelGrid> </p:rowExpansion> </p:dataTable> </h:form> </ui:define> </ui:composition> </h:body> </html> Error received in console:
ReferenceError: ajaxWaitCursorOn is not defined Specific error in primefaces generated javascript:
$(function(){PrimeFaces.cw("AjaxStatus","widget_j_id878804506_56ad391e",{id:"j_id878804506_56ad391e",delay:0,start:function(){ajaxWaitCursorOn()},success:function(){ajaxWaitCursorOff()}});}); Note 1: We tried changing it to use @Inject instead of calling the init method and got the same result.
Note 2: We verified that jQuery is loaded using a simple alert in the console.