0

I have set a message in FacesContext as following

FacesContext facesContext = phaseEvent.getFacesContext();
facesContext.addMessage("lynasTest", ExceptionConverter.getFacesMessage(facesContext, cee, false));

now in the xhml page i want to see this message. I have tried following

<h:message for="lynasTest" />
<h:messages for="lynasTest" globalOnly="true" warnClass="color:orange" />
#{lynasTest}

its not showing my message. How to fix this??

LynAs
  • 6,407
  • 14
  • 48
  • 83
  • We need more code. What do you do after setting the error? Redirecting o other page? Or is it an ajax call (are you updating the message components?)? – SJuan76 Nov 26 '14 at 09:17
  • I am redirecting to another page – LynAs Nov 26 '14 at 09:18
  • 1
    possible duplicate of [Preserving FacesMessage after redirect for presentation through in JSF](http://stackoverflow.com/questions/5137601/preserving-facesmessage-after-redirect-for-presentation-through-hmessage-in-j) – SJuan76 Nov 26 '14 at 10:22

1 Answers1

0

I needed to add a h:input field

<h:inputText id="errorMessage" style="display: none"/>
<h:message  for="errorMessage"/>
LynAs
  • 6,407
  • 14
  • 48
  • 83