[seam-commits] Seam SVN: r14687 - branches/community/Seam_2_3/jboss-seam-ui/src/main/java/org/jboss/seam/ui/renderkit.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Sun May 13 07:19:14 EDT 2012
Author: manaRH
Date: 2012-05-13 07:19:13 -0400 (Sun, 13 May 2012)
New Revision: 14687
Modified:
branches/community/Seam_2_3/jboss-seam-ui/src/main/java/org/jboss/seam/ui/renderkit/EqualityValidatorRendererBase.java
Log:
JBSEAM-4919 applied patch from Brian Leathem to fix attaching EqualityValidator for UIInput component
Modified: branches/community/Seam_2_3/jboss-seam-ui/src/main/java/org/jboss/seam/ui/renderkit/EqualityValidatorRendererBase.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-ui/src/main/java/org/jboss/seam/ui/renderkit/EqualityValidatorRendererBase.java 2012-05-12 07:45:15 UTC (rev 14686)
+++ branches/community/Seam_2_3/jboss-seam-ui/src/main/java/org/jboss/seam/ui/renderkit/EqualityValidatorRendererBase.java 2012-05-13 11:19:13 UTC (rev 14687)
@@ -6,6 +6,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.event.*;
import javax.faces.validator.Validator;
import org.jboss.seam.ui.component.UIEqualityValidator;
@@ -16,9 +17,11 @@
* This class mainly does some validation "hook-in"
*
* @author Daniel Roth
+ * @author <a href="http://community.jboss.org/people/bleathem">Brian Leathem</a>
*
*/
-public class EqualityValidatorRendererBase extends RendererBase
+ at ListenerFor(systemEventClass = PostAddToViewEvent.class)
+public class EqualityValidatorRendererBase extends RendererBase implements ComponentSystemEventListener
{
@Override
@@ -27,8 +30,7 @@
return UIEqualityValidator.class;
}
- @Override
- protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException
+ private void attachValidator(UIComponent component)
{
UIEqualityValidator ev = (UIEqualityValidator) component;
EditableValueHolder evh = null;
@@ -46,7 +48,6 @@
evh.setRequired(ev.isRequired());
}
- renderChildren(context, component);
}
private boolean hasEqualityValidator(EditableValueHolder evh)
@@ -67,4 +68,10 @@
return true;
}
+ @Override
+ public void processEvent(ComponentSystemEvent event) throws AbortProcessingException
+ {
+ UIComponent component = event.getComponent();
+ this.attachValidator(component);
+ }
}
More information about the seam-commits
mailing list