Martin
Martin

Reputation: 91

Primefaces password match unhandled message

I'm trying to get Primefaces 3.5 password matching to work and I keep getting an error saying "There are some unhandled FacesMessages", and no proper message is displayed as expected.

I have created a very simple page and copy'n'pasted the code from the Showcase to try to eliminate all other possible causes, but the problem is still happening. Here is the very simple page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
    <title>Primefaces Password Match Test</title>
    <link type="text/css" rel="stylesheet" href="#{facesContext.externalContext.requestContextPath}/css/custom.css" />
</h:head>
<h:body>
    <h:form id="form"> 
        <p:panel header="Match Mode">  
            <p:messages id="messages" showDetail="true" autoUpdate="true"/>
            <h:panelGrid columns="2" id="matchGrid">                     
                <h:outputLabel for="pwd1" value="Password 1: *" />  
                <p:password id="pwd1" value="#{passwordBean.password5}" match="pwd2" label="Password 1" required="true"/>
                <h:outputLabel for="pwd2" value="Password 2: *" />  
                <p:password id="pwd2" value="#{passwordBean.password5}" label="Password 2" required="true"/>  
            </h:panelGrid> 
            <p:commandButton id="saveButton" update="matchGrid" value="Save" />  
        </p:panel>  
    </h:form> 
</h:body>
</html>

The bean I'm using is an exact copy of the Showcases bean.

This is what I see in the console after typing different passwords and clicking Save:

[14/05/13 12:41:02:481 EST] 000000ee srt           W com.ibm.ws.webcontainer.srt.SRTServletResponse setIntHeader SRVE8094W: WARNING: Cannot set header. Response already committed.
[14/05/13 12:41:02:633 EST] 000000e8 srt           W com.ibm.ws.webcontainer.srt.SRTServletResponse setIntHeader SRVE8094W: WARNING: Cannot set header. Response already committed.
[14/05/13 12:41:09:371 EST] 000000e9 RenderRespons W   There are some unhandled FacesMessages, this means not every FacesMessage had a chance to be rendered.
These unhandled FacesMessages are: 
- Password 1 should match with Password 2.
[14/05/13 12:41:09:352 EST] 000000e9 SystemErr     R 10999369 [WebContainer : 1] INFO org.apache.bval.jsr303.ConfigurationImpl - ignoreXmlConfiguration == true

Upvotes: 1

Views: 1870

Answers (1)

Ssv
Ssv

Reputation: 1059

Instead of updating the matchGrid update the form. use update=@form

Upvotes: 1

Related Questions