Author: dsvyatobatsko
Date: 2008-07-08 11:34:36 -0400 (Tue, 08 Jul 2008)
New Revision: 9458
Modified:
trunk/sandbox/ui/beanValidator/src/main/config/component/beanValidator.xml
trunk/sandbox/ui/beanValidator/src/main/java/org/richfaces/component/UIBeanValidator.java
Log:
Modified: trunk/sandbox/ui/beanValidator/src/main/config/component/beanValidator.xml
===================================================================
--- trunk/sandbox/ui/beanValidator/src/main/config/component/beanValidator.xml 2008-07-08
15:22:53 UTC (rev 9457)
+++ trunk/sandbox/ui/beanValidator/src/main/config/component/beanValidator.xml 2008-07-08
15:34:36 UTC (rev 9458)
@@ -35,7 +35,23 @@
which validation will be triggered
</description>
<defaultvalue><![CDATA["onblur"]]></defaultvalue>
+ </property>
+ <property>
+ <name>ajaxSingle</name>
+ <classname>boolean</classname>
+ <description>
+ </description>
+ <defaultvalue>true</defaultvalue>
</property>
+<!--
+ <property disabled="false">
+ <name>bypassUpdates</name>
+ <classname>boolean</classname>
+ <description>
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+-->
</component>
<validator generate="false">
<id>org.richfaces.BeanValidator</id>
Modified:
trunk/sandbox/ui/beanValidator/src/main/java/org/richfaces/component/UIBeanValidator.java
===================================================================
---
trunk/sandbox/ui/beanValidator/src/main/java/org/richfaces/component/UIBeanValidator.java 2008-07-08
15:22:53 UTC (rev 9457)
+++
trunk/sandbox/ui/beanValidator/src/main/java/org/richfaces/component/UIBeanValidator.java 2008-07-08
15:34:36 UTC (rev 9458)
@@ -30,41 +30,50 @@
public abstract void setEvent(String event);
+ public abstract void setAjaxSingle(boolean single);
+
+ public abstract boolean isAjaxSingle();
+
+// public abstract boolean isBypassUpdates();
+//
+// public abstract void setBypassUpdates(boolean bypass);
+
public void setParent(UIComponent parent) {
super.setParent(parent);
- if (!(parent instanceof EditableValueHolder)) {
- throw new FaceletException("Parent component must be an
EditableValueHolder");
- }
+ if (null != parent && parent.getFamily() != null) {
- Validator[] validators = ((EditableValueHolder) parent).getValidators();
+ if (!(parent instanceof EditableValueHolder)) {
+ throw new FaceletException("Parent component must be an
EditableValueHolder");
+ }
- boolean isFacesValidatorPresent = false;
- for (Validator validator : validators) {
- if (validator instanceof FacesBeanValidator) {
- isFacesValidatorPresent = true;
- break;
+ Validator[] validators = ((EditableValueHolder) parent).getValidators();
+
+ boolean isFacesValidatorPresent = false;
+ for (Validator validator : validators) {
+ if (validator instanceof FacesBeanValidator) {
+ isFacesValidatorPresent = true;
+ break;
+ }
}
- }
- if (!isFacesValidatorPresent) {
- FacesBeanValidator validator = (FacesBeanValidator)
FacesContext.getCurrentInstance().getApplication()
- .createValidator("org.richfaces.BeanValidator");
- ((EditableValueHolder) parent).addValidator(validator);
- }
+ if (!isFacesValidatorPresent) {
+ FacesBeanValidator validator = (FacesBeanValidator)
FacesContext.getCurrentInstance().getApplication()
+ .createValidator("org.richfaces.BeanValidator");
+ ((EditableValueHolder) parent).addValidator(validator);
+ }
- FacesContext ctx = FacesContext.getCurrentInstance();
- ValueExpression binding =
ctx.getApplication().getExpressionFactory().createValueExpression(ctx.getELContext(),
- getEventString(), String.class);
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ ValueExpression binding =
ctx.getApplication().getExpressionFactory().createValueExpression(
+ ctx.getELContext(), getEventString(), String.class);
- parent.setValueExpression(getEvent(), binding);
+ parent.setValueExpression(getEvent(), binding);
+ }
}
private String getEventString()
{
StringBuffer buildOnEvent = new StringBuffer();
- // Due to JSF RI 1.1 bug, clear cached clientId
- setId(getId());
buildOnEvent.append(AjaxRendererUtils.buildOnEvent(this, getFacesContext(),
getEvent()));
return buildOnEvent.toString();
}
Show replies by date