在弹出面板显示之前,如何从备份bean中调用方法?
<h:commandButton value="Call the popup" action="#{bean.doSomething}" >
<rich:componentControl target="popup" operation="show" />
</h:commandButton>
<rich:popupPanel id="popup" modal="true" resizeable="true" onmaskclick="#{rich:component('popup')}.hide()">
...
</rich:popupPanel>在本例中,doSomething()方法不调用。
发布于 2012-03-17 21:23:45
在a4j:ajax中嵌套commandButton或使用a4j:commandButton。这两个组件都有一个oncomplete属性,您可以在其中放置一个代码,打开弹出对话框,如下所示:
<a4j:commandButton value="Call the popup" action="#{bean.doSomething}" oncomplete="#{rich:component('popup')}.show()">
</a4j:commandButton>这将在单击按钮时执行ajax请求,并在请求完成时打开弹出窗口。
https://stackoverflow.com/questions/9753163
复制相似问题