New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi-component validation #1
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented I have a form where the validators for some fields depend on the submitted |
@glassfishrobot Commented |
@glassfishrobot Commented
|
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented
|
@glassfishrobot Commented The current strategy puts the onus of having to convert the related field(s) on A better way to implement validation is to first convert all of the components Frankly, I don't feel it is the responsibility of the specification to create a |
@glassfishrobot Commented
IMO JSF should come complete out of the box and not require additional |
@glassfishrobot Commented Hello, we're looking to JSR-303 BeanValidation to help with this. In Ed Posted by: edburns on January 21, 2009 at 09:27 AM |
@glassfishrobot Commented [1] http://weblogs.java.net/blog/johnreynolds/archive/2004/07/improve_jsf_by_1.html |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented I would expect something like this: <f:validatorGroup name="insidePanel" validator="# {myBean.validatePanel} "/> {myBean.validateInput1} " validatorGroup="insidePanel"/> In this scenario, myBean.validatePanel() would be called, but sent in a Map<String, Object> of values, where String is the component id. validatePanel() wouldn't be called, however, unless myBean.validateInput1() executed successfully. |
@glassfishrobot Commented
For general purpose multi-component validation, requiring the components to use a hard coded ID might be problematic. These IDs may already be needed for other purposes. So in that case perhaps f:validatorGroup can take f:param children to indicate this, or the proposed validatorGroup attribute could include some kind of designator, e.g.:
|
@glassfishrobot Commented
|
@glassfishrobot Commented So we need a solution that works within the JSF validation mechanism, and action methods don't cut it. I've seen a people use the postValidate event for this, which does work, but it's not very elegant. Something like what Seam-Faces has would work out fine: http://docs.jboss.org/seam/3/faces/reference/snapshot/en-US/html_single/#validateForm. I would want it to work without CDI, though. This is a major whole in the JSF spec – I've seen people use different solutions on almost every project. |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented http://showcase.omnifaces.org/validators/validateMultiple I also like their other helpful validators such as <o:validateAll>, <o:validateAllOrNone>, <o:validateEqual>, <o:validateOne>, <o:validateOneOrMore>, <o:validateOneOrNone>, <o:validateOrder> or <o:validateUnique> |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented
Thus, IMHO we need conversion, (individual) validation for each component ant then group validation.
{myBean.validatePanel}"/>
The example from Arjan might take us into the right direction. But why is there an additional qualifier after the group name? And, in this example the group declares a validation method. Usually in JSF, we can declare a method using the validator attribute, or use a predefined validator (to be declared) by the validator tag. <f:validatorGroup name="insidePanel" validator="#{myBean.validatePanel} "> {myBean.validateInput1} " validatorGroup="insidePanel"/> This might offer a second approach beside bean validation. |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
Next spec should support multi-component validation.
Environment
Operating System: All
Platform: All
URL: http://weblogs.java.net/pub/wlg/1625
Affected Versions
[2.0]
The text was updated successfully, but these errors were encountered: