richfaces 进度条轮询
我的网页上有一个进度条组件定义如下:
<rich:modalPanel id="pb1Panel">
<rich:progressBar id="pb1" oncomplete="javascript:#{myBean.handleProgressEvent()} closeProgressModalPanel()" value="#{pb1Listener.percentageComplete}" label="#{pb1Listener.percentageComplete} %" minValue="1" maxValue="100" limitToList="true" timeout="3200" interval="1400" enabled="false"/>
</rich:modalPanel>
和一个按钮:
<a4j:commandButton id="actButton" value="action" action="#{myBean.performAction}" immediate="true" ajaxSingle="true" onclick="javascript:Richfaces.showModalPanel('pb1Panel');" reRender="pb1Panel">
<a4j:support event="onClick" value="#{rich:component('pb1')}.enable()" reRender="pb1" />
</a4j:commandButton>
不起作用。但是,如果我从进度条中取出
....
enabled="false"/>
....
,并从按钮中取出元素,一切似乎都工作正常。
有什么建议吗?为什么它不起作用?我最初设置启用=“假”,因为我不希望轮询开始,除非单击按钮(以减少不必要的轮询)。
该系统建立在 richfaces/seam 之上。
谢谢!
I've got a progressBar component defined as the following on my webpage:
<rich:modalPanel id="pb1Panel">
<rich:progressBar id="pb1" oncomplete="javascript:#{myBean.handleProgressEvent()} closeProgressModalPanel()" value="#{pb1Listener.percentageComplete}" label="#{pb1Listener.percentageComplete} %" minValue="1" maxValue="100" limitToList="true" timeout="3200" interval="1400" enabled="false"/>
</rich:modalPanel>
and a button:
<a4j:commandButton id="actButton" value="action" action="#{myBean.performAction}" immediate="true" ajaxSingle="true" onclick="javascript:Richfaces.showModalPanel('pb1Panel');" reRender="pb1Panel">
<a4j:support event="onClick" value="#{rich:component('pb1')}.enable()" reRender="pb1" />
</a4j:commandButton>
which doesn't work. However if I take out the
....
enabled="false"/>
....
from the progress bar, and the element from the button, everything seems to work just fine.
Any suggestion why it's not working? I'm setting enabled="false" initially because I do not want the polling to start unless the button was clicked (to reduce unnecessary polling).
The system is building on richfaces/seam.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
enabled
属性应该引用托管 bean 的属性,并且您的按钮应该更改它,然后重新渲染进度条。只需从此处复制粘贴示例 - 它正在做与你想要的完全相同的事情。
The
enabled
property should refer to a property of a managed bean, and your button should change it, then reRender the progress bar.Simply copy-paste the example from here - it's doing exactly the same thing as you want.