HatalarJSF
- Posted on
- Comments 0
Primefaces PF is not defined
Merhaba arkadaşlar ,
Primefaces’ın 4.0 versiyonunda gelen PF shorcut’ı 3.xx kullandığım için “PF is not defined” hatası ile karşılaştım. Önceki versiyonlardan hatırlamayanlar için bu hatanın çözümü şu şekilde ;
<p:column style="width:4%" headerText="Show">
<p:commandButton id="selectButton" oncomplete="videoDialog.show()" icon="ui-icon-search" title="View">
<f:setPropertyActionListener value="#{video}" target="#{videoController.selectedVideo}" />
</p:commandButton>
</p:column>
Action’ı yani onComplete event’ını widgetVar’ın ismi ile değiştirirseniz hatayı düzeltebilirsiniz. Aşağıda widgetVar ismi “videoDialog”. 4.0 => “PF(‘videoDialog’).show()”
3.xx => “videoDialog.show()”
<p:dialog header="Video Details" widgetVar="videoDialog" resizable="false" id="carDlg"
showEffect="fade" hideEffect="fade" modal="true">
<h:panelGrid id="display" columns="2" cellpadding="4" style="margin:0 auto;">
<h:outputText value="Model:" />
<h:outputText value="BB#{videoController.selectedVideo}" style="font-weight:bold"/>
</h:panelGrid>
</p:dialog>