开发者

how to check if modal panel is opened using javascript

Don't know how to check if modal Panel has been opened or not.

<a4j:commandButton id="backButtonId" value="#{msg.back}"
      action="#{someCommonAction}"
      oncomplete="if (  MyModalPanel Has Been Opened) #{rich:component('MyModalPanel').开发者_如何学JAVAhide() else Nothing;"
                           />

How can i do it with javascript but not using managed beans?

thank you for your answers in advance.


You could use jQuery.is() for this wherein you check if the element is :visible.

oncomplete="if (#{rich:component('MyModalPanel')}.is(':visible')) #{rich:component('MyModalPanel')}.hide();"

But this is useless. It doesn't harm to call hide() on an already hidden modal panel.

oncomplete="#{rich:component('MyModalPanel')}.hide();"


The following should do the trick for you:

#{rich:component('MyModalPanel')}.shown
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜