[
https://issues.apache.org/jira/browse/TAPESTRY-1383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483912
]
Arthur Tam commented on TAPESTRY-1383:
--------------------------------------
Problem remains, lib used:
backport-util-concurrent-3.0.jar
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-fileupload-1.1.1.jar
commons-io-1.1.jar
commons-lang-2.2.jar
commons-logging-1.0.3.jar
hivemind-1.1.1.jar
hivemind-lib-1.1.1.jar
javassist-3.4.jar
ognl-2.7-20070325.025541-16.jar
oro-2.0.8.jar
tapestry-annotations-4.1.2-20070321.174345-32.jar
tapestry-contrib-4.1.2-20070321.174345-34.jar
tapestry-framework-4.1.2-20070321.174345-38.jar
tapestry-portlet-4.1.2-20070321.174345-32.jar
> number translator
> -----------------
>
> Key: TAPESTRY-1383
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1383
> Project: Tapestry
> Issue Type: Bug
> Components: Framework
> Affects Versions: 4.0, 4.1.1
> Environment: windows 2k professional, tomcat 4.1.24, j2sdk 1.4.2_13,
> eclipse 3.2.1
> Reporter: Arthur Tam
> Fix For: 4.1.2
>
>
> - define html with an input field (going to capture a number with pattern
> #.##)
> - define translator: <binding name="translator"
> value="translator:number,pattern=#.##" />
> - define validators: <binding name="validators"
> value="validators:min=-1.23,max=20.12" />
> - code onSubmit listener for the form:
> public String onSubmit (IRequestCycle cycle) {
> ValidationDelegate delegate = (ValidationDelegate) ((IForm)
> getComponent("stockQuoteForm")).getDelegate();
> System.out.println("***");
> System.out.println(getStockPrice());
> if (delegate.getHasErrors()) {
> List ut = delegate.getAssociatedTrackings();
> if (ut != null && ut.size() > 0) {
> System.out.println("***");
> System.out.println(((IFieldTracking)
> ut.get(0)).getErrorRenderer().toString());
> }
> return null;
> }
> System.out.println("should not reach here if enter " +
> getStockPrice());
> return null;
> }
> }
> Test and result:
> - enter 0.123 to the input field and submit the form
> - console output messages:
> ***
> 0.123
> should not reach here if enter 0.123
> - As the input not conform to the pattern, it should fail the input. If it
> pass the input, it should trim the number for me i.e. return 0.12 when
> calling getStockPrice(), it is found that the screen just refresh with 0.12
> silently but internally, it is accepted the input.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]