[
http://www.stripesframework.org/jira/browse/STS-545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tim Fennell resolved STS-545.
-----------------------------
Resolution: Not a Bug
Assignee: Tim Fennell
This is the expected behaviour and is actually documented as such. The on=""
only applies to the requiredness of the field. This allows developers to make
a field required on certain events and optional on others, and still ensure
that it is valid when submitted.
For what you are trying to achieve the preferred method is to mark you cancel()
event handler with either @DontValidate or @DontBind which will turn off all
validation (for the former) or all validation and binding (for the latter).
This way you can annotate you cancel() event once and not have to litter each
of your properties with optional validations.
> Validate "expression" is validated not only for "on" methods
> ------------------------------------------------------------
>
> Key: STS-545
> URL: http://www.stripesframework.org/jira/browse/STS-545
> Project: Stripes
> Issue Type: Bug
> Components: ActionBean Dispatching
> Affects Versions: Release 1.4.3
> Reporter: Alexey
> Assignee: Tim Fennell
>
> The problem is that fro some reason the Validation "expression" is validated
> not only for "on" methods and that leads to some problems.
> I've a got a property in ActionBean
> @ValidateNestedProperties({
> @Validate(field = "qty", on = {"saveGroup"}, required=true,
> expression="this > 0")
> })
> protected ItemGroup itemGroup;
> and i have two methods saveGroup and cancelGroup.
> I've noticed that when I put wrong value in qty field (for example negative)
> and press cancel button which is mapped to call cancelGroup the check is
> performed, which in my opinion should not happen.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development