-
1. Re: Error handling with richfaces
ilya_shaikovsky Apr 1, 2009 11:28 AM (in response to iimirela)1) surround the modal panel with a4j:outputPanel with ajaxRendered=true
2) define showWhenRendered="not facesContext.maximumSeverity==null" on the modal
3) place rich:messages inside.
4) include to your main template.<a4j:outputPanel ajaxRendered="true"> <rich:modalPanel showWhenRendered="#{not (facesContext.maximumSeverity==null)}"> <rich:messages passedLabel="Data is allowed to be stored." layout="list"> <f:facet name="header"> <h:outputText value="Entered Data Status:"></h:outputText> </f:facet> <f:facet name="passedMarker"> <h:graphicImage value="/images/ajax/passed.gif" /> </f:facet> <f:facet name="errorMarker"> <h:graphicImage value="/images/ajax/error.gif" /> </f:facet> </rich:messages> </rich:modalPanel> </a4j:outputPanel>
-
2. Re: Error handling with richfaces
iimirela Apr 2, 2009 2:48 AM (in response to iimirela)Beautiful. Now of, course, depending on the page, I have different types of errors, and different messages. Should I use a binding? Can I set the message?
THanks -
3. Re: Error handling with richfaces
nbelaevski Apr 2, 2009 4:36 AM (in response to iimirela)Should I use a binding?
Please clarify what binding are you referring to?Can I set the message?
Messages are customized at component producing messages (e.g. using requiredMessage attribute) or at application level using message bundle. rich:messages just displays them. -
4. Re: Error handling with richfaces
iimirela Apr 2, 2009 4:43 AM (in response to iimirela)Right. I want to customize messages at application level, using messages bundle. How can I do that?
P.S: I meant a binding to the messages component... to set the message? Obviously I'm new in jsf :( -
5. Re: Error handling with richfaces
nbelaevski Apr 2, 2009 4:55 AM (in response to iimirela)Please take a look: http://www.ibm.com/developerworks/library/j-jsf3/ or consult JSF specification documents.
Binding is not required unless you want to create/modify component programmatically. -
6. Re: Error handling with richfaces
iimirela Apr 2, 2009 5:12 AM (in response to iimirela)Thank you very much. Very interesting and helpful article.