[richfaces-issues] [JBoss JIRA] Updated: (RF-10456) CLONE - rich:messages displays messages multiple times

Ilya Shaikovsky (JIRA) jira-events at lists.jboss.org
Tue Feb 8 07:47:47 EST 2011


     [ https://issues.jboss.org/browse/RF-10456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Shaikovsky updated RF-10456:
---------------------------------

             Fix Version/s:     (was: 3.Future)
         Affects Version/s: 4.0.0.Milestone6
                                (was: 3.3.0)
                                (was: 3.3.1)
                                (was: 3.3.2.CR1)
                                (was: 3.3.2.GA)
                                (was: 3.3.3.CR1)
                                (was: 3.3.2.SR1)
                                (was: 3.3.3.BETA1)
                                (was: 3.3.3.Final)
               Environment:     (was: Richfaces 3.3.0 upwards with integrated Spring Webflow (version 2.0.5) and Hibernate Validator 4.0.2.)
    Workaround Description:   (was: Downgrade to version 3.2.2.)
                Workaround:   (was: [Workaround Exists])
               Description: 
Clonned 3.3.x issue.
code used:
	<h:form>
		<rich:graphValidator value="#{userBean}">
			<rich:panel header="Change password" style="width:500px">
				<rich:messages/>
				<h:panelGrid columns="3"> 
					<h:outputText value="Enter new password:" />
					<h:inputSecret value="#{userBean.password}" id="pass" />
					<rich:message for="pass" />
					<h:outputText value="Confirm the new password:" />
					<h:inputSecret value="#{userBean.confirm}" id="conf" />
					<rich:message for="conf" />
				</h:panelGrid> 
				<h:commandButton value="submit" action="#{userBean.storeNewPassword}" />
				<a4j:commandButton value="Store changes"
					action="#{userBean.storeNewPassword}" />
			</rich:panel>
		</rich:graphValidator>
	</h:form>
and 
@ManagedBean
@RequestScoped
public class UserBean {

    @Size(min = 5, max = 15, message="Wrong size for password")
    private String password;
    @Size(min = 5, max = 15, message="Wrong size for confirmation")
    private String confirm;
    private String status = "";

    @AssertTrue(message = "Different passwords entered!")
    public boolean isPasswordsEquals() {
        return password.equals(confirm);
    }

    public void storeNewPassword(){
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Succesfully changed!", "Succesfully changed!"));
    }


after first click all the messages appears twice. After the second - looks ok.

  was:
Using a graphValidator, I set up a bean with Hibernate Validator annotations.

When multiple fields fail validation; the <rich:messages /> tag outputs the error messages multiple times.

It seems as though the message is displayed based on the number of failed fields.  For example; when 2 fields fail, it will display both error messages twice.  If 3 fields fail, it'll display all 3 messages 3 times, and so on.

I have managed to replicate the same error in versions 3.3.0 to 3.3.3.  I have not tried >4 as we need a stable release.  This may mean it could already be fixed in version 4; but I am submitting this issue regardless.

        Steps to Reproduce:   (was: Set up environment with Richfaces 3.3.3, Spring Webflow 2.0.5 and Hibernate Validator 4.0.2.
Create a form for a simple bean and use a <graphValidator /> for that bean.
Set up a single <rich:messages /> tag for that <graphValidator />.
Have more than one field fail validation.

The error messages will be repeated.)


> CLONE - rich:messages displays messages multiple times
> ------------------------------------------------------
>
>                 Key: RF-10456
>                 URL: https://issues.jboss.org/browse/RF-10456
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-validators
>    Affects Versions: 4.0.0.Milestone6
>            Reporter: Ilya Shaikovsky
>            Assignee: Alexander Smirnov
>
> Clonned 3.3.x issue.
> code used:
> 	<h:form>
> 		<rich:graphValidator value="#{userBean}">
> 			<rich:panel header="Change password" style="width:500px">
> 				<rich:messages/>
> 				<h:panelGrid columns="3"> 
> 					<h:outputText value="Enter new password:" />
> 					<h:inputSecret value="#{userBean.password}" id="pass" />
> 					<rich:message for="pass" />
> 					<h:outputText value="Confirm the new password:" />
> 					<h:inputSecret value="#{userBean.confirm}" id="conf" />
> 					<rich:message for="conf" />
> 				</h:panelGrid> 
> 				<h:commandButton value="submit" action="#{userBean.storeNewPassword}" />
> 				<a4j:commandButton value="Store changes"
> 					action="#{userBean.storeNewPassword}" />
> 			</rich:panel>
> 		</rich:graphValidator>
> 	</h:form>
> and 
> @ManagedBean
> @RequestScoped
> public class UserBean {
>     @Size(min = 5, max = 15, message="Wrong size for password")
>     private String password;
>     @Size(min = 5, max = 15, message="Wrong size for confirmation")
>     private String confirm;
>     private String status = "";
>     @AssertTrue(message = "Different passwords entered!")
>     public boolean isPasswordsEquals() {
>         return password.equals(confirm);
>     }
>     public void storeNewPassword(){
>         FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Succesfully changed!", "Succesfully changed!"));
>     }
> after first click all the messages appears twice. After the second - looks ok.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list