[richfaces-svn-commits] JBoss Rich Faces SVN: r5978 - in trunk/ui/progressBAR/src/main: resources/org/richfaces/renderkit/html/js and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Sat Feb 9 10:17:30 EST 2008


Author: andrei_exadel
Date: 2008-02-09 10:17:30 -0500 (Sat, 09 Feb 2008)
New Revision: 5978

Modified:
   trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
   trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
Log:
little changes for file upload component

Modified: trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java	2008-02-09 15:13:57 UTC (rev 5977)
+++ trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java	2008-02-09 15:17:30 UTC (rev 5978)
@@ -220,8 +220,8 @@
 	String formId = ((UIComponent) AjaxRendererUtils
 		.getNestingForm(component)).getClientId(context);
 	String mode = (String) component.getAttributes().get("mode");
-	Integer minValue = (Integer) component.getAttributes().get("minValue");
-	Integer maxValue = (Integer) component.getAttributes().get("maxValue");
+	Number minValue = getNumber(component.getAttributes().get("minValue"));
+	Number maxValue = getNumber(component.getAttributes().get("maxValue"));
 	Number  value = (Number)variables.getVariable("percent");
 	StringBuffer markup = getMarkup(context, component); 
 	

Modified: trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
--- trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js	2008-02-09 15:13:57 UTC (rev 5977)
+++ trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js	2008-02-09 15:17:30 UTC (rev 5978)
@@ -11,6 +11,7 @@
 		this.minValue = minValue;
 		this.maxValue = maxValue;
 		this.value = value;
+		this.disabled = false;
 	
 		this.context = context;
 		this.markup = markup;
@@ -28,7 +29,7 @@
 		return this.value;
 	},
 	onComplete: function (data) {
-	  	if (!$(this.id)) { return; } 
+	  	if (!$(this.id) || this.disabled) { return; } 
 		if (data) {
 			this.value = data['percent'];
 			if (this.state == "progressState") {
@@ -121,16 +122,7 @@
 		}
 		return placeholders;
 	},
-	setLabel: function (arg, params) {
-		var str;
-		
-		if (params && params.label) {
-			//componentControl
-			str = params.label;
-		} else {
-			str = arg;
-		}
-		
+	setLabel: function (str) {
 		if (this.state != "progressState") { return; }
 		var d = $(this.id + ":remain");
 		if (!d) { return; } 
@@ -148,20 +140,10 @@
 	getMinValue: function () {
 		return this.minValue;
 	},
-
 	isAjaxMode: function () {
 		return (this.getMode() == "ajax");
 	}, 
-	setValue: function (arg, params) {
-		var val;
-		
-		if (params && params.value) {
-			//componentControl
-			val = params.value;
-		} else {
-			val = arg;
-		}
-		
+	setValue: function (val) {
 		this.value = val;
 		var p = val;
 		val = "" + val;
@@ -192,6 +174,7 @@
 	
 	},
 	enable: function (ev) {
+		this.disabled = false;
 		if (!this.isAjaxMode()) {
 			this.switchState("progressState");
 			this.setValue(0);
@@ -201,6 +184,7 @@
 		}
 	},
 	disable: function () {
+		this.disabled = true;
 		A4J.AJAX.StopPoll(this.id);
 	},
 	finish: function () {




More information about the richfaces-svn-commits mailing list