You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Gerhard Petracek (Created) (JIRA)" <de...@myfaces.apache.org> on 2012/01/23 14:40:40 UTC

[jira] [Created] (EXTVAL-141) allow group validation triggered via an action-method

allow group validation triggered via an action-method
-----------------------------------------------------

                 Key: EXTVAL-141
                 URL: https://issues.apache.org/jira/browse/EXTVAL-141
             Project: MyFaces Extensions Validator
          Issue Type: New Feature
          Components: Bean Validation
    Affects Versions: 2.0.4
            Reporter: Igor Guimaraes
            Assignee: Gerhard Petracek


@BeanValidation(useGroups = MyGroup.class)
public String send()
{
    //...
    return "success";
}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (EXTVAL-141) allow group validation triggered via an action-method

Posted by "Gerhard Petracek (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/EXTVAL-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gerhard Petracek resolved EXTVAL-141.
-------------------------------------

    Resolution: Fixed

currently we only support action-methods without parameters as well as std. action-listeners.
action-methods with parameters might be supported later on, but we can't support multiple methods with the same name but different parameter/s. that's a basic el issue (if a parameter value resolves to null, it isn't possible to determine the type of the parameter).
                
> allow group validation triggered via an action-method
> -----------------------------------------------------
>
>                 Key: EXTVAL-141
>                 URL: https://issues.apache.org/jira/browse/EXTVAL-141
>             Project: MyFaces Extensions Validator
>          Issue Type: New Feature
>          Components: Bean Validation
>    Affects Versions: 2.0.4
>            Reporter: Igor Guimaraes
>            Assignee: Gerhard Petracek
>             Fix For: 2.0.7
>
>
> extval doesn't support the validateBean tag to keep the type-safety of bv-groups (instead @BeanValidation is provided). however, also the tag isn't what users need when it comes to group validation in several cases. with the tag it's just possible to specify groups for input components or disable bv with the disabled attribute.
> a lot of cases just require different actions within a form which should process the whole form in a different manner (= different or no bv-group/s). furthermore, there are several use-cases which require to bypass the validation process e.g. via a special group which isn't used for bv-constraints (see EXTVAL-142). in such cases the usage of the immediate attribute doesn't fit and the usage of the disabled attribute is more like a workaround.
> extval already provides @BeanValidation to 'useGroups' and 'restrictGroups' (optionally for specific views via 'viewIds' and/or specific conditions via 'conditions'). this feature allows to re-use this annotation also for action methods. so it's possible to use it for the scenarios mentioned above as well as EXTVAL-142.
> a simple example:
> @BeanValidation(useGroups = MyGroup.class)
> public String send()
> {
>     //...
>     return "success";
> }
> a button which is bound to this action method will remove all configured groups of the current form for the current request, add the groups listed in 'useGroups' and locks the internal context until the invoke application phase to avoid that further groups get added.
> we can also think about just adding the groups and use 'restrictGroups' to remove the groups which shouldn't be used. and only SkipValidation of EXTVAL-141 would trigger the behaviour described before.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (EXTVAL-141) allow group validation triggered via an action-method

Posted by "Gerhard Petracek (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/EXTVAL-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13507313#comment-13507313 ] 

Gerhard Petracek edited comment on EXTVAL-141 at 11/30/12 1:26 PM:
-------------------------------------------------------------------

currently we only support action-methods without parameters as well as std. action-listeners.
action-methods with parameters might be supported later on, but we can't support multiple methods with the same name but different parameter/s. that's a basic el issue (if a parameter value resolves to null, it isn't possible to determine the type of the parameter).

"workaround" for parameters:
 - f:attribute + ActionEvent#getComponent#getAttributes#get
or
 - f:setPropertyActionListener
                
      was (Author: gpetracek):
    currently we only support action-methods without parameters as well as std. action-listeners.
action-methods with parameters might be supported later on, but we can't support multiple methods with the same name but different parameter/s. that's a basic el issue (if a parameter value resolves to null, it isn't possible to determine the type of the parameter).
                  
> allow group validation triggered via an action-method
> -----------------------------------------------------
>
>                 Key: EXTVAL-141
>                 URL: https://issues.apache.org/jira/browse/EXTVAL-141
>             Project: MyFaces Extensions Validator
>          Issue Type: New Feature
>          Components: Bean Validation
>    Affects Versions: 2.0.4
>            Reporter: Igor Guimaraes
>            Assignee: Gerhard Petracek
>             Fix For: 2.0.7
>
>
> extval doesn't support the validateBean tag to keep the type-safety of bv-groups (instead @BeanValidation is provided). however, also the tag isn't what users need when it comes to group validation in several cases. with the tag it's just possible to specify groups for input components or disable bv with the disabled attribute.
> a lot of cases just require different actions within a form which should process the whole form in a different manner (= different or no bv-group/s). furthermore, there are several use-cases which require to bypass the validation process e.g. via a special group which isn't used for bv-constraints (see EXTVAL-142). in such cases the usage of the immediate attribute doesn't fit and the usage of the disabled attribute is more like a workaround.
> extval already provides @BeanValidation to 'useGroups' and 'restrictGroups' (optionally for specific views via 'viewIds' and/or specific conditions via 'conditions'). this feature allows to re-use this annotation also for action methods. so it's possible to use it for the scenarios mentioned above as well as EXTVAL-142.
> a simple example:
> @BeanValidation(useGroups = MyGroup.class)
> public String send()
> {
>     //...
>     return "success";
> }
> a button which is bound to this action method will remove all configured groups of the current form for the current request, add the groups listed in 'useGroups' and locks the internal context until the invoke application phase to avoid that further groups get added.
> we can also think about just adding the groups and use 'restrictGroups' to remove the groups which shouldn't be used. and only SkipValidation of EXTVAL-141 would trigger the behaviour described before.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira