[richfaces-svn-commits] JBoss Rich Faces SVN: r12357 - in trunk/sandbox/ui/colorPicker/src/main: resources/org/richfaces/ui/renderkit/html/scripts and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Jan 20 15:57:32 EST 2009


Author: artdaw
Date: 2009-01-20 15:57:32 -0500 (Tue, 20 Jan 2009)
New Revision: 12357

Modified:
   trunk/sandbox/ui/colorPicker/src/main/java/org/richfaces/ui/renderkit/ColorPickerRendererBase.java
   trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/scripts/ui.colorpicker.js
   trunk/sandbox/ui/colorPicker/src/main/templates/org/richfaces/ui/htmlColorPicker.jspx
Log:
colorPicker: ui bug were fixed

Modified: trunk/sandbox/ui/colorPicker/src/main/java/org/richfaces/ui/renderkit/ColorPickerRendererBase.java
===================================================================
--- trunk/sandbox/ui/colorPicker/src/main/java/org/richfaces/ui/renderkit/ColorPickerRendererBase.java	2009-01-20 20:30:59 UTC (rev 12356)
+++ trunk/sandbox/ui/colorPicker/src/main/java/org/richfaces/ui/renderkit/ColorPickerRendererBase.java	2009-01-20 20:57:32 UTC (rev 12357)
@@ -3,9 +3,11 @@
 import java.io.IOException;
 import java.util.Map;
 import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.ajax4jsf.util.InputUtils;
 import org.richfaces.ui.component.UIColorPicker;
 
 public abstract class ColorPickerRendererBase  extends HeaderResourcesRendererBase{
@@ -21,4 +23,20 @@
 			colorPicker.setSubmittedValue(submittedValue);
 		}
 	}	
+	
+	public String getInputValue(FacesContext context, UIInput input) {
+		String inputValue = "";
+		
+		String submittedValue = (String) input.getSubmittedValue();
+		if (submittedValue != null) {
+			inputValue = submittedValue;
+		} else {
+			Object value = input.getValue();
+			if (value != null) {
+				inputValue = InputUtils.getConvertedStringValue(context, input, value);
+			}
+		}
+		
+		return inputValue;
+	}
 }
\ No newline at end of file

Modified: trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/scripts/ui.colorpicker.js
===================================================================
--- trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/scripts/ui.colorpicker.js	2009-01-20 20:30:59 UTC (rev 12356)
+++ trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/scripts/ui.colorpicker.js	2009-01-20 20:57:32 UTC (rev 12357)
@@ -425,7 +425,7 @@
 			var t3 = (t1-t2)*(h%60)/60;
 			if(h==360) h = 0;
 			if(h<60) {rgb.r=t1;	rgb.b=t2; rgb.g=t2+t3;}
-			else if(h<120) {rgb.g=t1; rgb.b=t2;	rgb.r=t1-t3;}
+			else if(h<120) {rgb.g=t1; `rgb.b=t2;	rgb.r=t1-t3;}
 			else if(h<180) {rgb.g=t1; rgb.r=t2;	rgb.b=t2+t3;}
 			else if(h<240) {rgb.b=t1; rgb.r=t2;	rgb.g=t1-t3;}
 			else if(h<300) {rgb.b=t1; rgb.g=t2;	rgb.r=t2+t3;}

Modified: trunk/sandbox/ui/colorPicker/src/main/templates/org/richfaces/ui/htmlColorPicker.jspx
===================================================================
--- trunk/sandbox/ui/colorPicker/src/main/templates/org/richfaces/ui/htmlColorPicker.jspx	2009-01-20 20:30:59 UTC (rev 12356)
+++ trunk/sandbox/ui/colorPicker/src/main/templates/org/richfaces/ui/htmlColorPicker.jspx	2009-01-20 20:57:32 UTC (rev 12357)
@@ -68,7 +68,7 @@
 	</script>
 	</div>
 	<span id="#{clientId}colorPicker" class="rich-colorPicker-span"	x:passThruWithExclusions="value,name,type,id,styleClass,class,style">
-		<input readonly="readonly" disabled="#{disabled}" type="text" />
+		<input readonly="readonly" disabled="#{disabled}" type="text" name="#{clientId}" value="#{this:getInputValue(context, component)}"/>
 		<jsp:scriptlet>
 			<![CDATA[if(component.getFacet("icon")!=null && component.getFacet("icon").isRendered()) {]]>
 		</jsp:scriptlet>        




More information about the richfaces-svn-commits mailing list