仅针对特定组件的ajaxStatus [英] ajaxStatus for specific component only
问题描述
我在JSF 2.0中使用Primefaces 3.2.
I'm using Primefaces 3.2 with JSF 2.0.
我正在使用
<p:commandButton action="#{myBackingBean.action}" value="press me" />
这对于ajaxStatus:
And this for ajaxStatus:
<p:ajaxStatus onstart="statusDialog.show();"
onsuccess="statusDialog.hide();"
rendered="#{myBackingBean.ajaxStatusRendered}"
id="ajaxStatusField" />
<p:dialog modal="true" widgetVar="statusDialog"
header="#{myBackingBean.ajaxStatusHeader}"
rendered="#{myBackingBean.ajaxStatusRendered}" id="ajaxPanel"
draggable="false" closable="false">
<p:graphicImage value="./images/ajaxloader.gif" />
</p:dialog>
同一页面上还有很多其他primefaces组件,但是我只希望在按下此特定按钮时呈现p:ajaxStatus.有什么好的解决办法吗?每个ajax事件都会呈现ajaxStatus.
I've got lots of other primefaces components also on the same page, but I only want the p:ajaxStatus to render when this specific button is pressed. Any good solution to this? The ajaxStatus renders on every ajax event..
推荐答案
如果按钮数量很少,则可以在它们上设置global="false"
,然后保留所需的按钮,而无需进行此设置.
If you have a few amount of buttons, you could set on them global="false"
and leave the desired button without this setting.
这样,所有其他按钮都不会触发p:ajaxStatus
,而所需按钮会触发.
This way all other buttons wouldn't trigger the p:ajaxStatus
while the desired button would.
这篇关于仅针对特定组件的ajaxStatus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!