[richfaces-issues] [JBoss JIRA] Commented: (RF-7634) UIRichMessages doesn't render global messages when globalOnly is false

Michael Seghers (JIRA) jira-events at lists.jboss.org
Mon Aug 3 05:25:29 EDT 2009


    [ https://jira.jboss.org/jira/browse/RF-7634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12478567#action_12478567 ] 

Michael Seghers commented on RF-7634:
-------------------------------------

Hello Nick,

this is my code to test the issue:

in the backing bean:

public void addGlobalAndFieldMessage(final ActionEvent event) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        facesContext.addMessage(null, new FacesMessage("summary global", "detail global"));
        facesContext.addMessage("field", new FacesMessage("summary field", "detail field"));
}

on the page:

<rich:messages id="messageArea" />
<h:form>
        <h:inputText id="field"/>
        <h:commandButton actionListener="#{testBackingBean.addGlobalAndFieldMessage}" value="show messages"/>
</h:form>

result is I only see the message "summary field", but I should also get "summary global", right?

when I add globalOnly="true" on the messages component, I obviously only see the "summary global" which is as expected.

Could you try my code?

> UIRichMessages doesn't render global messages when globalOnly is false
> ----------------------------------------------------------------------
>
>                 Key: RF-7634
>                 URL: https://jira.jboss.org/jira/browse/RF-7634
>             Project: RichFaces
>          Issue Type: Bug
>          Components: component-output
>    Affects Versions: 3.3.0, 3.3.1
>            Reporter: Michael Seghers
>            Assignee: Nick Belaevski
>             Fix For: 3.3.2.GA
>
>
> Taken following code snippet from the UIRichMessages.getMessages(FacesContext)
> if (isGlobalOnly()) {
> 	addMessagesForId(context, null, severenities);
> } else if (null != forInputId) {
> 	UIComponent componentFor = RendererUtils.getInstance()
> 		.findComponentFor(context, this, forInputId);
> 	if (null != componentFor) {
> 		addMessagesForId(context, componentFor.getClientId(context), severenities);
> 	}
> } else {
> 	Iterator<String> clientIdsWithMessages = context.getClientIdsWithMessages();
> 	while (clientIdsWithMessages.hasNext()) {
> 		addMessagesForId(context, clientIdsWithMessages.next(), severenities);
> 	}
> }
> This means that the call to addMessagesForId(context, null, severenities) is only called in when  globalOnly is true, but it should also be called in the last else part, where all messages should be rendered.

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

        


More information about the richfaces-issues mailing list