Permalink
Browse files

Fix serialization bug when <o:validator> is declared inside

<cc:implementation> itself.
  • Loading branch information...
1 parent 5b72ca5 commit a0884acb1bb519ae9c710b07bd1a5f389e585636 @BalusC BalusC committed Apr 15, 2015
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/main/java/org/omnifaces/taghandler/Validator.java
@@ -101,13 +101,15 @@ public Validator(ValidatorConfig config) {
*/
@Override
public void apply(FaceletContext context, UIComponent parent) throws IOException {
- if (!ComponentHandler.isNew(parent) && UIComponent.getCompositeComponentParent(parent) == null) {
+ boolean insideCompositeComponent = UIComponent.getCompositeComponentParent(parent) != null;
+
+ if (!ComponentHandler.isNew(parent) && !insideCompositeComponent) {
// If it's not new nor inside a composite component, we're finished.
return;
}
- if (!(parent instanceof EditableValueHolder)) {
- // It's likely a composite component. TagHandlerDelegate will pickup it and pass the target component back.
+ if (!(parent instanceof EditableValueHolder) || (insideCompositeComponent && getAttribute("for") == null)) {
+ // It's inside a composite component and not reattached. TagHandlerDelegate will pickup it and pass the target component back if necessary.
super.apply(context, parent);
return;
}

0 comments on commit a0884ac

Please sign in to comment.