-
1. Re: How to rendering f:validateBean validationGroups value
bleathem Jun 26, 2013 1:45 AM (in response to wish79)1 of 1 people found this helpfulThe validationGroups EL may be getting evaluated at the time it is put in the component tree, and not re-evaluated after you update the value.
-
2. Re: How to rendering f:validateBean validationGroups value
wish79 Jun 26, 2013 3:39 AM (in response to bleathem)Thanks, is there any work around
-
3. Re: How to rendering f:validateBean validationGroups value
bleathem Jun 26, 2013 11:24 AM (in response to wish79)You could look at invoking your bean validation programmatically.
-
4. Re: How to rendering f:validateBean validationGroups value
george-kislyak May 27, 2015 7:56 AM (in response to wish79)Faced with the same issue. Came out with a hack based on this article: Delete the components holding unwanted state | LogikDevelopment.
Basically, you need to remove from tree components you want to update validators for, so they will be reinitialized during rendering.
E.g. if you are executing a section with ajax, you can call a method like this in action listener:
public void resetContactsValidationGroups() {
Iterator<String> ids = FacesContext.getCurrentInstance().getPartialViewContext().getExecuteIds().iterator();
while (ids.hasNext()) {FacesContext.getCurrentInstance().getViewRoot().findComponent(ids.next()).getChildren().clear();
}}