myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (TOMAHAWK-1276) validator property not fireing validator method
Date Mon, 16 Jun 2008 03:13:45 GMT

    [ https://issues.apache.org/jira/browse/TOMAHAWK-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605187#action_12605187
] 

Leonardo Uribe commented on TOMAHAWK-1276:
------------------------------------------

After doing some test the conclusion is that the problem is not on tomcat, is on myfaces core
1.2.3.

The problem is not present when using tomahawk12-1.1.7-SNAPSHOT + myfaces 1.2.3

> validator property not fireing validator method
> -----------------------------------------------
>
>                 Key: TOMAHAWK-1276
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1276
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Validators
>    Affects Versions: 1.1.6
>         Environment: WinXp, MyFaces 1.2.3, Tomcat 6.0.14, Java jdk1.6.0_03, JSF On JSP
>            Reporter: David Waters
>            Priority: Critical
>
> on at least t:inputHidden the validator has no effect.
> Simple Example
> <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
> <f:view>
> 	<html>
> 		<head></head>
> 		<body>
> 			<h:form id="testForm">
> 				<h:messages />
> 				<t:inputHidden value="123321" id="tomHiddenField" validator="#{test.tomNeverValid}"
required="true" />
> 				<h:inputHidden value="123321" id="jsfHiddenField" validator="#{test.jsfNeverValid}"
required="true"/>
> 				
> 				<h:commandButton value="Test" id="btn" />			
> 			</h:form>			
> 		</body>	
> 	</html>
> </f:view>
> public class Test{
> 	private static final Logger logger = Logger.getLogger(Test.class);
> 	public void tomNeverValid(FacesContext context, UIComponent comp, Object value){
> 		logger.error("This is never called");
> 		throw new ValidatorException(new FacesMessage("This does not show."));
> 	}
> 	
> 	public void jsfNeverValid(FacesContext context, UIComponent comp, Object value){
> 		logger.debug("This Jsf Validator Called");
> 		throw new ValidatorException(new FacesMessage("This does show."));
> 	}
> }
> Actual Behaviour:
> On clicking the button to submit this form only one validation message is display, "This
does show" this is produced by the h:inputhidden
> Expected Behaviour:
> On clicking the button to submit this form only both validation message are displayed
> Notes: The h:inputHidden ends up adding a validator to the validators collection not
storing the validate express ion directly see
> org.apache.myfaces.taglib.html.HtmlInputHiddenTag.setProperties()
> if (_validator != null)
>   {
>     comp.addValidator(new MethodExpressionValidator(_validator));
> }
> org.apache.myfaces.shared_tomahawk.taglib.UIComponentTagBase.setProperties(..)
> calls 
> org.apache.myfaces.shared_tomahawk.taglib.UIComponentTagUtils.setValidatorProperty(...)
stores on calls UIInput.setValidator
> this._validator = validator;
> in UIInput ._validator is not mentioned in saveState or restoreState.
> Note: this functionality worked in MyFaces 1.2.0, upgrading to MyFaces 1.2.3 broke this,
I belive this will effect all input tags.

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


Mime
View raw message