admin管理员组

文章数量:1402407

I used the same one as in primefaces which is: .jsf

<p:ajaxStatus onstart="statusDialog.show();"       onsuccess="statusDialog.hide();"/>
<p:dialog modal="true" widgetVar="statusDialog" header="Status"   
    draggable="false" closable="false">  
<p:graphicImage value="/design/ajaxloadingbar.gif" />  
</p:dialog>  

my page never shows the content if this piece of code exists. When I inspect with firebug, the js error is Uncaught ReferenceError: statusDialog is not defined.

I used the same one as in primefaces which is: http://www.primefaces/showcase/ui/ajaxStatusScript.jsf

<p:ajaxStatus onstart="statusDialog.show();"       onsuccess="statusDialog.hide();"/>
<p:dialog modal="true" widgetVar="statusDialog" header="Status"   
    draggable="false" closable="false">  
<p:graphicImage value="/design/ajaxloadingbar.gif" />  
</p:dialog>  

my page never shows the content if this piece of code exists. When I inspect with firebug, the js error is Uncaught ReferenceError: statusDialog is not defined.

Share Improve this question asked Feb 13, 2014 at 15:15 Gary LeatherGary Leather 3812 gold badges6 silver badges18 bronze badges 4
  • Not sure of what exactly happening but instead you can have your ajaxStatus like this <p:ajaxStatus> <f:facet name="start"> <p:graphicImage value="ajaxloading.gif" /> </f:facet> </p:ajaxStatus> – Srikanth Ganji Commented Feb 13, 2014 at 15:26
  • but with this I can not show effect as dialog. – Gary Leather Commented Feb 13, 2014 at 15:37
  • check the diference <p:ajaxStatus onstart="PF('statusDialog').show();" onsuccess="PF('statusDialog').hide();"/> – meyquel Commented Feb 13, 2014 at 17:13
  • maybe you can use BlockUI ponent, primefaces/showcase-ext/views/home.jsf – meyquel Commented Feb 13, 2014 at 17:15
Add a ment  | 

1 Answer 1

Reset to default 8

What Primefaces´ version are you using?

Primefaces from 4 to 5 changed the way to access widget ponents:

Widgets must be referenced via "PF". e.g. PF('widgetVarName').show() instead of widgetVarName.show();

https://code.google./p/primefaces/wiki/MigrationGuide

本文标签: javascriptPrimefaces ajaxstatus error(dialog is not defined)Stack Overflow