Andrea Martino created JBSEAM-4949:
--------------------------------------

             Summary: Seam annotated JSF validator breaks JPDL navigation
                 Key: JBSEAM-4949
                 URL: https://issues.jboss.org/browse/JBSEAM-4949
             Project: Seam 2
          Issue Type: Bug
          Components: JSF Integration
    Affects Versions: 2.3.0.BETA1
         Environment: JBoss AS 7.1.1.Final + RichFaces.4.2.0.Final + Seam 
2.3.0.Beta1
            Reporter: Andrea Martino


An seam annotated JSF validator does not behave as it should when used within a 
JPDL navigation.

For example, the following JSF form should go to the second page in the 
pageflow after "conversationTest.success()" method is executed. If the 
"myValidator" is annotated using @FacesValidator, everything is fine. 
Otherwise, if it is validated using seam tags, the framework starts a new 
conversation after the button is clicked.

{code:xml:title=form.xhtml}
<h:form>
    <div>
        <h:inputText id="textInput" value="#{conversationTest.text}">
            <f:validator validatorId="myValidator"/>  
        </h:inputText>
    </div>
    <h:commandButton action="#{conversationTest.success}" value="Success" />
</h:form>
{code} 

If the validator is annotated as following, everything is fine:
{code:title=MyValidator.java}
package com.example.validator;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException;

@javax.faces.validator.FacesValidator("myValidator")
public class FacesValidator implements javax.faces.validator.Validator{
        
        public void validate(FacesContext facesContext, UIComponent 
uIComponent, Object bDate) throws ValidatorException {
                // empty method. Don't do anything
        }
}
{code}

Othewise, it the validator is annotated as following the JPDL annotation is 
broken:
{code:title=MyValidator.java}
package com.example.validator;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.faces.Validator;
import org.jboss.seam.annotations.intercept.BypassInterceptors;

@Name("myValidator")
@BypassInterceptors
@Scope(ScopeType.STATELESS)
@Validator
public class SeamValidator implements javax.faces.validator.Validator{
    
    public void validate(FacesContext facesContext, UIComponent uIComponent, 
Object bDate) throws ValidatorException {
                // empty method. Don't do anything
    }
}
{code}

This issue is probably related to JBSEAM-4944

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
seam-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-issues

Reply via email to