Like @hendinas answer, this is not a solution to a specific problem, but may be useful for future Googlers who have the same error but for a different reason.
This is an additional case of @hendinas answer, but where is the thing you are talking about not found, because it does not have the same rendered conditions. Here is an example.
<ui:repeat id="extSyses" var="extSys" value="${cc.attrs.externalSystems}" varStatus="extSysLoop"> <h:commandButton id="YesButton" value="Yes" type="button" rendered='#{(rptBean.canEditReport or rptBean.canAnnotateReport) and not extSys.closed)}' onclick="PF('#{cc.attrs.prefix}yesDlg#{extSysLoop.index}').show()" /> <p:dialog id="extDocDlg" header='Enter document reference number' rendered='#{rptBean.canEditReport and not extSys.closed)}' widgetVar="#{cc.attrs.prefix}yesDlg#{extSysLoop.index}" width="650" minWidth="650" modal="true"> ... Dialog Content ... </p:dialog> </ui:repeat>
In this case, widgetVar matches the onclick value, so that was good. However, the rendered sentence was different. If canEditReport was true, everything worked fine. However, if canAnnotateReport was true, then a button will appear, but it will not have a dialog to display! When the button is pressed, the message TypeError: PF(…) is undefined .
In this example, the solution is to make rendered sentences the same for both the button and the dialog that it refers to.
source share