[
https://issues.apache.org/struts/browse/STR-2319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39958
]
Henri Yandell commented on STR-2319:
------------------------------------
Only ints are supported by the grammar at the moment, the '0.0' works because
you're doing String comparison. I think that doing 0.0 without the quotes would
have worked too, but it would really have been working at the String level and
you'd have found bugs like STR-2321 when you got to comparison.
> [validator] Validwhen and floats(maybe integers)
> ------------------------------------------------
>
> Key: STR-2319
> URL: https://issues.apache.org/struts/browse/STR-2319
> Project: Struts 1
> Issue Type: Improvement
> Components: Core
> Affects Versions: Future
> Environment: Operating System: All
> Platform: PC
> Reporter: Nuno Furtado
> Assigned To: Struts Developers
> Priority: Minor
>
> I needed to validate a field if another one was diferent than zero, it should
> be
> expected that i was able to do it like so :
> <field property="outros" depends="validwhen">
> <arg2 key="compostagemdataForm.outros.invalido"/>
> <var>
> <var-name>test</var-name>
> <var-value>(qtoutros==0)</var-value>
> </var>
> </field>
> For some reason this rule allways failed. i had to reformulate the rule :
> <field property="outros" depends="validwhen">
> <arg2 key="compostagemdataForm.outros.invalido"/>
> <var>
> <var-name>test</var-name>
> <var-value>(qtoutros=='0.0') </var-value>
> </var>
> </field>
> wich is weird! qtoutros is a String property on the bean, but can be converted
> to float.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.