[
http://www.stripesframework.org/jira/browse/STS-901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12940#comment-12940
]
Marcus Kraßmann commented on STS-901:
-------------------------------------
This is documented behaviour. The "on" attribute is just a swich for the
"required" validation, nothing else. The reason behind this: if you don't need
to enter something into a field but you still do it, then it should meet the
validation expression.
> Validate on= is always validating when used with an expression
> --------------------------------------------------------------
>
> Key: STS-901
> URL: http://www.stripesframework.org/jira/browse/STS-901
> Project: Stripes
> Issue Type: Bug
> Components: Validation
> Affects Versions: Release 1.5.7
> Reporter: Richard Biswell
> Priority: Minor
> Labels: validation
>
> I have an action with two events: Save and Publish. I require a property to
> only be set on the publish event, so I have the following annotation:
> @ValidateNestedProperties({
> @Validate(field = "videoType", required = true, on =
> "publish"),
> @Validate(field = "template.id", required = true,
> expression = "presentation.template.id > 0", on="publish"),
> @Validate(field = "name", required = true, on = {
> "save", "publish" } ) })
> private Presentation presentation;
> Whenever I click save the template.id expression is validated, I would expect
> this to only get validated on publish.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development