Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3579

Inconsistent message order in h:messages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.8
    • 2.0.15, 2.1.9
    • None
    • None

    Description

      Hi,

      with template:

      <h:form>
      <h:messages />

      <h:inputText required="true" label="1" />
      <h:inputText required="true" label="2" />
      <h:inputText required="true" label="3" />
      <h:commandButton value="Submit" />
      </h:form>

      messages in h:messages doesn't match order of components, h:messages will show:

      2: Validation error
      3: Validation error
      1: Validation error

      It looks like that problem occurs when h:messages element is wrapped in another component, because this works:

      <h:messages />
      <h:form>
      <h:inputText required="true" label="1" />
      <h:inputText required="true" label="2" />
      <h:inputText required="true" label="3" />
      <h:commandButton value="Submit" />
      </h:form>

      but this doesn't:

      <h:panelGroup>
      <h:messages />

      <h:form>
      <h:inputText required="true" label="1" />
      <h:inputText required="true" label="2" />
      <h:inputText required="true" label="3" />
      <h:commandButton value="Submit" />
      </h:form>
      </h:panelGroup>

      With Mojarra h:messages or PrimeFaces p:messages order matches component order.

      Regards,
      Pavel

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            pavel.arnost Pavel Arnošt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: