In following code: code1 onClick function opensUp a RichFace popup panel. i need the onComplete fuction to execute after the closing of the popup. how can i delay the onComplete function. Is there a way to check whether the popup is visible or not as shown in the code2 so that this execution is delayed.
The code1:<a onclick ="showPopup('popup1')" oncomplete="" > Input </a>
The code2:<a onclick ="showPopup('popup1'); while(isVisible('popup1')){ }"
oncomplete="" > Input </a>
Asked
Active
Viewed 404 times
0

Sudarshan Shenoy
- 59
- 8
-
Why don't you use `onhide`? – Emil Sierżęga Jul 08 '16 at 15:34
-
I am very new to RichFaces. how to use onhide? Is it like this `` – Sudarshan Shenoy Jul 08 '16 at 16:57
1 Answers
0
Just use onhide
attribute from rich:popupPanel
. The description of it is: The client-side code executed after the popup disappears.
<h:commandButton value="Call the popup">
<rich:componentControl target="popup" operation="show" />
</h:commandButton>
<rich:popupPanel id="popup" modal="true"
onhide="alert('My popup is now hidden!')"
onshow="alert('This popup just pop out!');">
<!-- (... some body ...) -->
</rich:popupPanel>
If you really want to check in JavaScript if the popup is hidden or visible, then use RichFaces
object in JavaScript, find popup and check shown
field. An example:
if (RichFaces.$('MyPopupId').shown) {alert('Shown')} else {alert('Hidden')}
Check RichFaces VDL for more info.

Emil Sierżęga
- 1,785
- 2
- 31
- 38