9

I created an user interface with a form to get information from user. When I submit the form, it prints the following warning in the server log:

INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=j_idt7:j_idt11[severity=(ERROR 2), summary=(j_idt7:j_idt11: Validation Error: Value is not valid), detail=(j_idt7:j_idt11: Validation Error: Value is not valid)]

I tried to solve it, however I didn't understand how. How is this problem caused and how can I solve it?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Do Thanh Tung
  • 1,223
  • 2
  • 19
  • 30

3 Answers3

10

As to the warning referring an undisplayed Validation Error: Value is not valid message, this means that you've somewhere a <h:selectXxx> component such as <h:selectOneMenu> without an associated <h:message> and therefore JSF is not able to display faces messages about conversion/validation errors directly in the UI.

In order to fix the particular warning, just add a <h:message>:

<h:selectOneMenu id="foo" ... />
<h:message for="foo" />

Note that when you're ajax-submitting the form using <f:ajax>, then you should not forgot to include the messages in the ajax-update. To start with, use render="@form" to update the entire form.

As to the concrete validation error problem which is mentioned in the message, head to the following answer: Validation Error: Value is not valid.

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

If you are using primefaces, dont forget to add:

    <h:form>
        <p:growl id="messages" showDetail="true" />
        ....
    </h:form>
Led Machine
  • 7,122
  • 3
  • 47
  • 49
  • Not specifically needed. `h:mesage`, `h:messages` or the p counterparts works as well as long a you follow common jsf guidelines – Kukeltje Dec 24 '18 at 07:08
  • Well, indeed Led Machine said "if you're using Primefaces". Depending by the case, `p:growl` can be more appropriate. – Marco Sulla Mar 15 '23 at 15:07
-2

It is invalid value problem. Most probably you entered character instead of integer value. Check this and I suggest exception handling to not face these type of problems again.

berkancetin
  • 315
  • 1
  • 3
  • 18