Madhav Bhargava schrieb: > felix.bec...@t-systems.com schrieb: > >> Hi, >> >> I've got a JSF page divided in 2 parts - the status message area and >> the content area. The content area is positioned under the status >> message area. In the status area all messages for the user should be >> shown - for example success messages, error messages and exceptions. >> In my content area I've got a <tr:dataTable >> value="#{myBean.values}"..>. When the method getValues() of myBean >> throws an exception, I'm catching this exception. I want to display >> this exception in the status message area - but this does not work - >> apparently because the status area is already rendered when the >> content el-methods are called. Is there any solution for this problem? >> Is it possible to render the status area at last? >> >> > One quick solution can be to call a javascript function on onload. This > function can do an ajax submit and re-render the status area of your JSP. If > there are any error messages then that will displayed else nothing will be > displayed. > If you want more control then do not add the FacesMessage to the > FacesContext, instead handle it yourself. > Will re-rendering messages using a separate ajax request work?
FacesMessage objects are attached to the FacesContext, not the view. And a FacesContext is a request-scoped object. So AFAIK, a second request will always see an empty messages list... Regards, Simon -- -- Emails in "mixed" posting style will be ignored -- (http://en.wikipedia.org/wiki/Posting_style)