Popup Richfaces Panel

How can I call the method from the backup bean in front of the popup panel?

<h:commandButton value="Call the popup" action="#{bean.doSomething}" >
    <rich:componentControl target="popup" operation="show" />

<rich:popupPanel id="popup" modal="true" resizeable="true" onmaskclick="#{rich:component('popup')}.hide()">


In this case, the doSomething () method does not call.


source to share

3 answers

Nest a4j:ajax

in commandButton

or use a4j:commandButton

. These two components have an attribute oncomplete

where you can put code that opens a popup dialog, for example:

<a4j:commandButton value="Call the popup" action="#{bean.doSomething}" oncomplete="#{rich:component('popup')}.show()">


This will execute the ajax request when the button is clicked, and open a popup when the request is complete.



You can just use f:ajax

show popup on successful response

Also see



I think you should use an actionListener in this case. The action is used to change the view and I am assuming you just want to show the popup.

MAG, Milo



All Articles