On 9/5/06, andyhot <[EMAIL PROTECTED]> wrote:
Zsombor wrote:
>
> This is for working number validation :
>
I think Jesse had originally written this... Can you describe when it fails?
BTW, there are requests in Tapestry for BigInteger and BigDecimal
validators.
Well, basicly when it have to do something :) If you write any num alphanumeric character to the field, it's fails with class cast exception. I wrote a little page to show that, in the attachment.
BR
Zsombor
Index: demo/src/net/sf/tacos/demo/pages/bugs/RealNumberPage.java =================================================================== --- demo/src/net/sf/tacos/demo/pages/bugs/RealNumberPage.java (revision 0) +++ demo/src/net/sf/tacos/demo/pages/bugs/RealNumberPage.java (revision 0) @@ -0,0 +1,57 @@ +/******************************************************************************* + * Tacos - 2006 + * + * Created by: zsombor + * + * +// Copyright 2004, 2005 The Apache Software Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + *******************************************************************************/ +package net.sf.tacos.demo.pages.bugs; + +import java.math.BigDecimal; + +import net.sf.tacos.form.validator.RealNumberValidator; + +import org.apache.tapestry.form.validator.BaseValidator; + + +/** + * <p>This class </p> + * <ul> + * <li></li> + * </ul> + * + * @author zsombor + */ +public abstract class RealNumberPage extends BaseBugPage { + + public abstract Double getDoubleValue(); + public abstract Float getFloatValue(); + public abstract BigDecimal getBigDecimalValue(); + + + /** + * [EMAIL PROTECTED] + */ + public void doNothing() + { + System.out.println("double:"+getDoubleValue()+" float:"+getFloatValue()+", bigdecimal:"+getBigDecimalValue()); + } + + public BaseValidator createValidators() { + return new RealNumberValidator(); + } + +} Index: demo/docroot/WEB-INF/bugs/RealNumberValidator.page =================================================================== --- demo/docroot/WEB-INF/bugs/RealNumberValidator.page (revision 0) +++ demo/docroot/WEB-INF/bugs/RealNumberValidator.page (revision 0) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE page-specification PUBLIC + "-//Apache Software Foundation//Tapestry Specification 4.0//EN" + "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd"> + +<page-specification class="net.sf.tacos.demo.pages.bugs.RealNumberPage"> + + <description>Real number validator demo page</description> + + + <property name="bigDecimalValue"/> + <property name="doubleValue"/> + <property name="floatValue"/> + + + +</page-specification> Index: demo/docroot/WEB-INF/bugs/RealNumberValidator.html =================================================================== --- demo/docroot/WEB-INF/bugs/RealNumberValidator.html (revision 0) +++ demo/docroot/WEB-INF/bugs/RealNumberValidator.html (revision 0) @@ -0,0 +1,11 @@ +<body jwcid="@Border" title="RealNumber Validator error"> + + <form jwcid="@Form" > + Big decimal:<input jwcid="@TextField" value="ognl:bigDecimalValue" validators="ognl:createValidators()"/> <br/> + Double: <input jwcid="@TextField" value="ognl:doubleValue" validators="ognl:createValidators()"/> <br/> + Float: <input jwcid="@TextField" value="ognl:floatValue" validators="ognl:createValidators()"/> <br/> + + <input type="submit" jwcid="@Submit" listener="listener:doNothing"/> + </form> + +</body> \ No newline at end of file
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Tacos-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tacos-devel
