Author: andrei_exadel
Date: 2008-03-13 10:59:53 -0400 (Thu, 13 Mar 2008)
New Revision: 6783
Modified:
trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
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:
RF-2474
Modified: trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
===================================================================
---
trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-03-13
14:59:33 UTC (rev 6782)
+++
trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-03-13
14:59:53 UTC (rev 6783)
@@ -93,6 +93,7 @@
String clientId = this.getClientId(facesContext);
if (!params.containsKey(clientId)) {
+ System.out.println("Return from broadcast");
return;
}
@@ -120,6 +121,7 @@
}
}
} else if (params.containsKey(FORCE_PERCENT_PARAM)) {
+ System.out.println("Force state: " + this.getClientId(facesContext));
ajaxContext.addComponentToAjaxRender(this);
}
Modified:
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
---
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-03-13
14:59:33 UTC (rev 6782)
+++
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-03-13
14:59:53 UTC (rev 6783)
@@ -230,11 +230,12 @@
.findAjaxContainer(context, component)).getClientId(context);
String mode = (String) component.getAttributes().get("mode");
UIComponent form = AjaxRendererUtils.getNestingForm(component);
- String formId = null;
+ String formId = "";
if (form != null) {
formId = form.getClientId(context);
}else if ("ajax".equals(mode)){
- throw new FaceletException("Progress bar component in ajax mode should be
placed inside the form");
+ // Ignore form absent. It can be rendered by forcing from any component
+ //throw new FaceletException("Progress bar component in ajax mode should be
placed inside the form");
}
Number minValue = getNumber(component.getAttributes().get("minValue"));
Number maxValue = getNumber(component.getAttributes().get("maxValue"));
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-03-13
14:59:33 UTC (rev 6782)
+++
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-03-13
14:59:53 UTC (rev 6783)
@@ -5,7 +5,12 @@
this.id = id;
this.containerId = containerId;
- this.formId = formId;
+ if (formId != '') {
+ this.formId = formId;
+ }else {
+ var f = this.getForm();
+ this.formId = (f) ? f.id : null;
+ }
this.mode = mode;
this.state = state;
this.minValue = minValue;
@@ -24,6 +29,14 @@
this.progressVar = progressVar;
$(this.id).component = this;
},
+
+ getForm: function () {
+ var parentForm = $(this.id);
+ while (parentForm.tagName && parentForm.tagName.toLowerCase() !=
'form') {
+ parentForm = parentForm.parentNode;
+ }
+ return parentForm;
+ },
getValue: function () {
return this.value;
Show replies by date