javascript - Primefaces ajaxstatus error(dialog is not defined) - Stack Overflow

I used the same one as in primefaces which is: .jsf<p:ajaxStatus onstart="statusDialog.show();

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744335975a4569117.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信