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" />
</h:commandButton>

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

      

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

+3


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()">
</a4j:commandButton>

      



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

+5


source


You can just use f:ajax

show popup on successful response

Also see



+1


source


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

+1


source







All Articles