Posted by Mustafa Sait Özen in , , , ,

Prevent RichFaces ModalPanel from Closure

If you want to prevent rich:modalPanel from closure when an error message occurs, you should follow this cheat :)

By using a4j:commandButton "data" property, you can set number of FacesMessages into "data". Checking "data" property in JavaScript can control ModalPanel's closing event.





< a4j:commandButton value="Do Something and Close" action="#{fooBean.doSomething}"
data="#{facesMessages.currentMessages.size()}"
oncomplete="if (data == 0) Richfaces.hideModalPanel('modalPanelID');" />



In this example no success message should be sent with FacesMessages :)
Another solution : ModalPanelValidation

This entry was posted on Pazartesi, Ocak 25, 2010 at Pazartesi, Ocak 25, 2010 and is filed under , , , , . You can follow any responses to this entry through the comments feed .

0 yorum

Yorum Gönder