You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Adam Winer (JIRA)" <my...@incubator.apache.org> on 2005/07/05 23:31:10 UTC

[jira] Created: (MYFACES-304) FacesContext.getClientIdsWithMessages() fails to return null

FacesContext.getClientIdsWithMessages() fails to return null
------------------------------------------------------------

         Key: MYFACES-304
         URL: http://issues.apache.org/jira/browse/MYFACES-304
     Project: MyFaces
        Type: Bug
    Versions: 1.0.9 beta    
    Reporter: Adam Winer


If a global message is added to the FacesContext (clientId is null), then someone calls getClientIdsWithMessages(), the Iterator that is returned should include null.  It does not;  it does correctly do this on the RI.

Also, from code inspection, it appears that getClientIdsWithMessages() will return a client ID twice if two messages are added against the same client ID.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-304) FacesContext.getClientIdsWithMessages() fails to return null

Posted by "Grant Smith (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-304?page=comments#action_12315167 ] 

Grant Smith commented on MYFACES-304:
-------------------------------------

Good point. OK, I swiched to LinkedHashSet and patched HtmlMessagesRendererBase.

Test it out a bit and let me know if I can close.



> FacesContext.getClientIdsWithMessages() fails to return null
> ------------------------------------------------------------
>
>          Key: MYFACES-304
>          URL: http://issues.apache.org/jira/browse/MYFACES-304
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Adam Winer
>     Assignee: Grant Smith

>
> If a global message is added to the FacesContext (clientId is null), then someone calls getClientIdsWithMessages(), the Iterator that is returned should include null.  It does not;  it does correctly do this on the RI.
> Also, from code inspection, it appears that getClientIdsWithMessages() will return a client ID twice if two messages are added against the same client ID.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-304) FacesContext.getClientIdsWithMessages() fails to return null

Posted by "Adam Winer (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-304?page=comments#action_12315156 ] 

Adam Winer commented on MYFACES-304:
------------------------------------

Use LinkedHashSet instead of HashSet to preserve the order in which IDs are added (which gives better results in h:messages, etc.).

Also HtmlMessagesRendererBase will now render global messages twice when globalOnly is false.  Simple fix;  change:
            _globalMessagesIterator = facesContext.getMessages(null);
            if (globalOnly)
            {
                _clientIdsWithMessagesIterator = NullIterator.instance();
            }
            else
            {
                _clientIdsWithMessagesIterator = facesContext.getClientIdsWithMessages();
            }
to:
            if (globalOnly)
            {
                 _globalMessagesIterator = facesContext.getMessages(null);
                _clientIdsWithMessagesIterator = NullIterator.instance();
            }
            else
            {
                _globalMessagesIterator = NullIterator.instance();
                _clientIdsWithMessagesIterator = facesContext.getClientIdsWithMessages();
            }


> FacesContext.getClientIdsWithMessages() fails to return null
> ------------------------------------------------------------
>
>          Key: MYFACES-304
>          URL: http://issues.apache.org/jira/browse/MYFACES-304
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Adam Winer
>     Assignee: Grant Smith

>
> If a global message is added to the FacesContext (clientId is null), then someone calls getClientIdsWithMessages(), the Iterator that is returned should include null.  It does not;  it does correctly do this on the RI.
> Also, from code inspection, it appears that getClientIdsWithMessages() will return a client ID twice if two messages are added against the same client ID.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MYFACES-304) FacesContext.getClientIdsWithMessages() fails to return null

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-304?page=all ]
     
Martin Marinschek closed MYFACES-304:
-------------------------------------

    Resolution: Fixed

No negative feedback, so I suppose I can be closing this out.

regards,

Martin

> FacesContext.getClientIdsWithMessages() fails to return null
> ------------------------------------------------------------
>
>          Key: MYFACES-304
>          URL: http://issues.apache.org/jira/browse/MYFACES-304
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Adam Winer
>     Assignee: Grant Smith

>
> If a global message is added to the FacesContext (clientId is null), then someone calls getClientIdsWithMessages(), the Iterator that is returned should include null.  It does not;  it does correctly do this on the RI.
> Also, from code inspection, it appears that getClientIdsWithMessages() will return a client ID twice if two messages are added against the same client ID.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-304) FacesContext.getClientIdsWithMessages() fails to return null

Posted by "Adam Winer (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-304?page=comments#action_12315631 ] 

Adam Winer commented on MYFACES-304:
------------------------------------

There's a bug in the new code:  getClientIdsWithMessages() is returning the NULL_DUMMY object (instead of null).

I don't see a reason why the NULL_DUMMY trick needs to be used anymore;  you can add null directly to the lists.

> FacesContext.getClientIdsWithMessages() fails to return null
> ------------------------------------------------------------
>
>          Key: MYFACES-304
>          URL: http://issues.apache.org/jira/browse/MYFACES-304
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Adam Winer
>     Assignee: Grant Smith

>
> If a global message is added to the FacesContext (clientId is null), then someone calls getClientIdsWithMessages(), the Iterator that is returned should include null.  It does not;  it does correctly do this on the RI.
> Also, from code inspection, it appears that getClientIdsWithMessages() will return a client ID twice if two messages are added against the same client ID.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-304) FacesContext.getClientIdsWithMessages() fails to return null

Posted by "Grant Smith (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-304?page=comments#action_12315152 ] 

Grant Smith commented on MYFACES-304:
-------------------------------------

I modified ServletFacesContextImpl:

1. getClientIdsWithMessages() now returns an Iterator of a HashSet built from the _messageClientIds List (thus unique)
2. removed the code which stripped the null from the Iterator.

Please test before I close this  :)


> FacesContext.getClientIdsWithMessages() fails to return null
> ------------------------------------------------------------
>
>          Key: MYFACES-304
>          URL: http://issues.apache.org/jira/browse/MYFACES-304
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Adam Winer
>     Assignee: Grant Smith

>
> If a global message is added to the FacesContext (clientId is null), then someone calls getClientIdsWithMessages(), the Iterator that is returned should include null.  It does not;  it does correctly do this on the RI.
> Also, from code inspection, it appears that getClientIdsWithMessages() will return a client ID twice if two messages are added against the same client ID.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-304) FacesContext.getClientIdsWithMessages() fails to return null

Posted by "Grant Smith (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-304?page=comments#action_12315637 ] 

Grant Smith commented on MYFACES-304:
-------------------------------------

Fixed. If you wouldn't mind re-testing, that would be a great help. I will add unit tests for this class as soon as our testing framework is in place.

Thanks

> FacesContext.getClientIdsWithMessages() fails to return null
> ------------------------------------------------------------
>
>          Key: MYFACES-304
>          URL: http://issues.apache.org/jira/browse/MYFACES-304
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Adam Winer
>     Assignee: Grant Smith

>
> If a global message is added to the FacesContext (clientId is null), then someone calls getClientIdsWithMessages(), the Iterator that is returned should include null.  It does not;  it does correctly do this on the RI.
> Also, from code inspection, it appears that getClientIdsWithMessages() will return a client ID twice if two messages are added against the same client ID.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira