0

Primefaces required=true attribute for input fields and calendar fields is working but the error messages are not getting displayed. I confirmed this as I am not able to go to another screen there is an issue with <p:messages> not working on IE. I am facing with <f:validator> in Internet Explorer browser as I have kept a debug point on the validator I am not able to reach that debug point. I am able to invoke the validator method with Mozilla Firefox and go to the debug point and able to display my error messages using <p:messages>.

<h:form id="formId">
    <h:inputText value="#{bean.xxx}" required="true" requiredMessage="this is required field" />
    <p:calendar value="#{bean.yyy}" required="true" requiredMessage="date is required field" />
    <p:commandButton action="save" update="formId" value="Save" />
</h:form>

I have also used update="formid" for the button.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Shashi
  • 1,112
  • 2
  • 17
  • 32
  • You know, you can [edit your question](http://stackoverflow.com/posts/7809767/edit) if it needs to be fixed. Please don't ask it again. –  Oct 19 '11 at 11:51

2 Answers2

1

When a form submit works in browser X, but not in browser Y, then this is an indication of a problem in the JSF-generated HTML/JS code.

Assuming that you're using the latest stable JSF and PrimeFaces versions, then any potential JS problems for such a trivial form is likely to be excluded. The only cause left is then an invalid HTML structure. Ensure that your HTML is syntactically valid. This covers among others that you should not nest multiple <form> elements in each other. From the JSF side on, thus thus means that you should thus ensure that you do not nest multiple <h:form> components in each other.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
1

Try using <p:messages> at the top and update it on clicking. Validators should fullfil it if wrong answer are given, and then, this should be written.

Anon
  • 21
  • 1