You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mb...@apache.org on 2005/08/02 11:40:27 UTC
svn commit: r226977 -
/myfaces/api/trunk/src/java/javax/faces/component/UIInput.java
Author: mbr
Date: Tue Aug 2 02:40:24 2005
New Revision: 226977
URL: http://svn.apache.org/viewcvs?rev=226977&view=rev
Log:
fix for MYFACES-277
submitted value is not set to null if the validation phase is
not called by using a command with immediate=true
Modified:
myfaces/api/trunk/src/java/javax/faces/component/UIInput.java
Modified: myfaces/api/trunk/src/java/javax/faces/component/UIInput.java
URL: http://svn.apache.org/viewcvs/myfaces/api/trunk/src/java/javax/faces/component/UIInput.java?rev=226977&r1=226976&r2=226977&view=diff
==============================================================================
--- myfaces/api/trunk/src/java/javax/faces/component/UIInput.java (original)
+++ myfaces/api/trunk/src/java/javax/faces/component/UIInput.java Tue Aug 2 02:40:24 2005
@@ -28,6 +28,8 @@
import javax.faces.event.ValueChangeListener;
import javax.faces.render.Renderer;
import javax.faces.validator.Validator;
+
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -52,6 +54,7 @@
private MethodBinding _validator = null;
private MethodBinding _valueChangeListener = null;
private List _validatorList = null;
+ private boolean _isValidated = false;
public Object getSubmittedValue()
{
@@ -153,6 +156,7 @@
context.renderResponse();
}
}
+ _isValidated = true;
}
public void processUpdates(FacesContext context)
@@ -180,6 +184,18 @@
//We (re)set to valid, so that component automatically gets (re)validated
setValid(true);
super.decode(context);
+ }
+
+ /**
+ * @see javax.faces.component.UIComponentBase#encodeBegin(javax.faces.context.FacesContext)
+ */
+ public void encodeBegin(FacesContext context) throws IOException
+ {
+ if(!_isValidated)
+ {
+ setSubmittedValue(null);
+ }
+ super.encodeBegin(context);
}
public void broadcast(FacesEvent event)