[ 
https://issues.apache.org/jira/browse/MYFACES-3579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407853#comment-13407853
 ] 

Leonardo Uribe commented on MYFACES-3579:
-----------------------------------------

In this case, it seems FacesContext.getClientIdsWithMessages() use _messages 
HashMap directly to return the iterator. In this case the solution is use 
LinkedHashMap, so the iterator returned preserve the order of the key/value 
pairs.
                
> Inconsistent message order in h:messages
> ----------------------------------------
>
>                 Key: MYFACES-3579
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3579
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.1.8
>            Reporter: Pavel Arnošt
>            Priority: Minor
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to