Problem with the "match" attribute of a text field

0

I'm using the match attribute of a <p:password/> , but it does not work properly.

<p:password id="senha"/>
<p:password match="senha"/>

When I send the form via commandButton , an error message appears, saying that the passwords do not match, even though I have put the characters the same. How can I resolve it?

    
asked by anonymous 27.11.2014 / 23:26

1 answer

1

Follow the @Patrick example

<h:panelGrid columns="2" id="matchGrid" cellpadding="5">                   
    <h:outputLabel for="pwd1" value="Password 1: *" />
    <p:password id="pwd1" value="#{passwordView.password5}" match="pwd2" label="Password 1" required="true" />

    <h:outputLabel for="pwd2" value="Password 2: *" />
    <p:password id="pwd2" value="#{passwordView.password5}" label="Password 2" required="true" />
</h:panelGrid>

In fact the API itself checks with match what is missing from your code is the attribute that the password will receive on your View

    
28.11.2014 / 00:54