I'm on the process of migrating an application from PrimeFaces 3.5 to 7.0, right now I have already make alot of things work but alot other I have no clue whats going on ;p
Currently I found out that I have a problem with this code:
<!-- <!DOCTYPE html> -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head/>
<h:body onload="actualizarSaldosCajero();" >
<h:form>
<p:remoteCommand name="actualizarSaldosCajero"
onstart="PF('ajaxStatus').show();"
action="#{plantillaGeneralMB.actualizarSaldosCajero}" />
</h:form>
<p:dialog widgetVar="ajaxStatus">
Content
</p:dialog>
</h:body>
</html>
Managed bean:
@ManagedBean
@SessionScoped
public class PlantillaGeneralMB implements Serializable {
private static final long serialVersionUID = 1L;
public void actualizarSaldosCajero() throws Exception {
try {
System.out.println("Here is alot of java code but not needed to reproduce error which is just on loading or refreshing the xhtml");
} catch (Exception e) {
throw e;
}
}
}
when I run my program with that code I get this error on navigator console:
TypeError: PF(...) is undefined
and if I open the trace it goes to onload() method, so searching I found this:
Execute managebean method from javascript onload event
which tells that if using PrimeFaces I can use autoRun="true" attribute on my remoteCommand instead of using the onload(), so thats what I did changed the remoteCommand
to this:
<p:remoteCommand autoRun="true" name="actualizarSaldosCajero"
onstart="PF('ajaxStatus').show();"
action="#{plantillaGeneralMB.actualizarSaldosCajero}" />
but now on my navigator console I still get the same error but now I also get that warning on the title, and the stacktrace of the error
"TypeError: PF(...) is undefined"
ends on JQUERY 2.
Hope some kind of advice for solving these, I gotta add that I'm not manually adding any JQuery to my xhtmls because I read that PrimeFaces already has its own JQuery (See answer from BalusC Adding jQuery to PrimeFaces results in Uncaught TypeErrors)