0

I have a form where I post some data using ajax. Error message back is validationfailed. The reason for that scenario is that I am expecting a number and the user typed in a character.

I can't get this error message to display in . It's as if validation has failed but no reason is given. I tried <p:message> or <h:message>. I can print a diagnostic message by checking rendered="#{facesContext.validationFailed or not empty facesContext.messageList}"

How can I see or show that the validation has failed since

<p:inputText value="#{bean.vacancies}"
             id="numberWorkersWidgetId"
             maxlength="2"
             />

, was not a number?

Message Panel is as follows

<h:panelGroup id="messagePanelId">
   <p:messages  showDetail="true" closable="true" autoUpdate="true" globalOnly="true">
      <p:effect event="load" type="pulsate" delay="800" speed="2000">
          <f:param name="times" value="1"/>
      </p:effect>
   </p:messages>

   <p:messages id="workDaysMessageId" showDetail="true" closable="true" autoUpdate="false" globalOnly="false"                                     redisplay="false">
    <p:effect event="load" type="pulsate" delay="800" speed="2000">
          <f:param name="times" value="1"/>
    </p:effect>
 </p:messages>

work monitored
  • 431
  • 6
  • 17
  • 1
    Just to exclude the obvious, is the `` component itself updated during ajax request? If not, also not after adding `autoUpdate="true"` to it? Nonetheless, in the future please always post problematic code in MCVE flavor. See also http://stackoverflow.com/tags/jsf/info – BalusC Jan 29 '16 at 17:34
  • I see the XML component being updated but there is no message displayed since update itself does contain any messages. – work monitored Jan 29 '16 at 17:45
  • 1
    You have one `p:messages` with `autoUpdate="true"` AND `globalOnly="true"` (so that won't show any validation messages) and you have one with `autoUpdate="false"` and `globalOnly="false"`, but you don't explicitly update that, so it won't show any messages either. Hence no messages would be shown... – Kukeltje Jan 30 '16 at 10:13

0 Answers0