You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Ali Ok (JIRA)" <de...@myfaces.apache.org> on 2010/10/06 23:05:31 UTC

[jira] Commented: (MYFACES-2939) f:event type=postValidate does not work

    [ https://issues.apache.org/jira/browse/MYFACES-2939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918686#action_12918686 ] 

Ali Ok commented on MYFACES-2939:
---------------------------------

I tested this on Tomcat and Jetty, not working on them as well (aside from GAE).

Not checked the spec whether something wrong about the coding here, but since it works in Mojarra, this seems like a bug.

> f:event type=postValidate does not work
> ---------------------------------------
>
>                 Key: MYFACES-2939
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2939
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: All
>            Reporter: Werner Punz
>
> From the mailinglist following bug was reported by Nikolai Rychkov
> (I have to add I could reproduce the bug here on my machine as well, even
> with a field being set to required so that validation definitely is called)
> Original Message:
> I try this simple example. But event doesn't be invoked. It looks like
> <f:event type="postValidate"> doesn't work
> <?xml version="1.0" encoding="UTF-8"?>
> <!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:f="http://java.sun.com/jsf/core"
>         xmlns:h="http://java.sun.com/jsf/html"
>         xmlns:ui="http://java.sun.com/jsf/facelets"
>         >
> <h:head>
>     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
>     <title></title>
> </h:head>
> <h:body>
>     <h:form id="form">
>         <f:event type="postValidate" listener="#{user.validate}"/>
>         <h3>Please enter your name and password.</h3>
>         <table>
>             <tr>
>                 <td>Name:</td>
>                 <td><h:inputText id="name" value="#{user.name}"/></td>
>             </tr>
>             <tr>
>                 <td>Password:</td>
>                 <td><h:inputSecret id="password"
> value="#{user.password}"/></td>
>             </tr>
>         </table>
>         <p><h:commandButton id="button" value="Login" action="welcome"/></p>
>     </h:form>
> </h:body>
> </html>
> @ManagedBean(name = "user")
> @SessionScoped
> public class UserBean implements Serializable {
>     private Logger log = LoggerFactory.getLogger(UserBean.class);
>     private String name;
>     private String password;
>     private static final long serialVersionUID = -7858335225156624734L;
>     public String getName() {    return name;    }
>     public void setName(String newValue) {        name = newValue;    }
>     public String getPassword() {    return password;    }
>     public void setPassword(String newValue) {        password = newValue;
> }
>     public void validate(ComponentSystemEvent e) {
>         log.info("========================================");
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.