This content has been marked as final.
Show 6 replies
-
1. Re: How to get rich:message from code
markjstang May 10, 2008 5:27 PM (in response to lucab)Is this what you were looking for:
rendered="#{not empty facesMessages.currentGlobalMessages}"
-
2. Re: How to get rich:message from code
lucab May 10, 2008 6:00 PM (in response to lucab)i can't test that now (it's midnight here) but if that works it's what i was trying to do. many thanks
-
3. Re: How to get rich:message from code
lucab May 10, 2008 6:20 PM (in response to lucab)all i can get is facesContext.messages...(i'm not using seam) but that does not work as expected (i can't discriminate the severity of the messages so i get them all)
-
4. Re: How to get rich:message from code
danielk Oct 14, 2008 4:29 AM (in response to lucab)I write a session bean with following method:
public boolean isGlobalMessages() { Iterator<?> iterator = FacesContext.getCurrentInstance().getMessages(null); if(iterator.hasNext()) { _logger.debug("One or more global message(s) found."); return true; } else { _logger.debug("No global messages found."); } return false; }
No you can use it in your site by writing:rendered="#{sessionBean.globalMessages}"
But i see, this thread was 5 Month ago created - perhaps this came a little to late :( -
5. Re: How to get rich:message from code
ilya_shaikovsky Oct 14, 2008 5:40 AM (in response to lucab)DanielK, If you need jsut check messages presence it's even easier to write
rendered="#{facesContext.maximumSeverity}"
without any beans definitions. -
6. Re: How to get rich:message from code
danielk Feb 8, 2009 6:50 AM (in response to lucab)Nice 2 know. Thanks for this answer, i will try this and remove my "workaround" :)