[richfaces-svn-commits] JBoss Rich Faces SVN: r6035 - trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Feb 12 11:57:17 EST 2008


Author: vmolotkov
Date: 2008-02-12 11:57:17 -0500 (Tue, 12 Feb 2008)
New Revision: 6035

Modified:
   trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
Log:
decode method

Modified: trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java	2008-02-12 16:56:49 UTC (rev 6034)
+++ trunk/sandbox/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java	2008-02-12 16:57:17 UTC (rev 6035)
@@ -1,5 +1,7 @@
 package org.richfaces.renderkit;
 
+import java.util.Map;
+
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
@@ -9,6 +11,7 @@
 import org.ajax4jsf.javascript.ScriptString;
 import org.ajax4jsf.javascript.ScriptUtils;
 import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.ajax4jsf.util.InputUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.richfaces.component.UIInplaceInput;
@@ -28,6 +31,40 @@
         return UIInplaceInput.class;
     }
     
+    protected void doDecode(FacesContext context, UIComponent component) {
+	UIInplaceInput inplaceInput = null;
+
+	if (component instanceof UIInplaceInput) {
+	    inplaceInput = (UIInplaceInput) component;
+	} else {
+	    if (logger.isDebugEnabled()) {
+		logger.debug("No decoding necessary since the component " 
+			     + component.getId() + 
+			     " is not an instance or a sub class of UIComboBox");
+	    }
+	    return;
+	}	
+	
+	if (InputUtils.isDisabled(inplaceInput) || InputUtils.isReadOnly(inplaceInput)) {
+	    if (logger.isDebugEnabled()) {
+		logger.debug(("No decoding necessary since the component "
+			      + component.getId() + " is disabled"));
+		}
+	}
+	
+	String clientId = component.getClientId(context);
+	if (clientId == null) {
+	    throw new NullPointerException("component " + inplaceInput.getClientId(context) + " client id is NULL" );
+	}
+	
+	clientId = clientId + "value";		
+	Map request = context.getExternalContext().getRequestParameterMap();
+	if (request.containsKey(clientId)) {
+		String newValue = (String)request.get(clientId);
+		inplaceInput.setSubmittedValue(newValue);
+	}
+    }
+    
     public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
 	String event = (String) component.getAttributes().get(attributeName);
 	ScriptString result = JSReference.NULL;




More information about the richfaces-svn-commits mailing list