Author: pyaschenko
Date: 2009-04-21 10:13:21 -0400 (Tue, 21 Apr 2009)
New Revision: 13729
Modified:
trunk/ui/progressBAR/src/main/config/component/progressBar.xml
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:
https://jira.jboss.org/jira/browse/RF-6744
Modified: trunk/ui/progressBAR/src/main/config/component/progressBar.xml
===================================================================
--- trunk/ui/progressBAR/src/main/config/component/progressBar.xml 2009-04-21 13:51:19 UTC
(rev 13728)
+++ trunk/ui/progressBAR/src/main/config/component/progressBar.xml 2009-04-21 14:13:21 UTC
(rev 13729)
@@ -174,6 +174,18 @@
but just allows to avoid unnecessary updates on the client side if the response isn't
actual now
</description>
</property>
+ <property hidden="true" >
+ <name>onkeydown</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property hidden="true">
+ <name>onkeypress</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property hidden="true">
+ <name>onkeyup</name>
+ <classname>java.lang.String</classname>
+ </property>
</component>
</components>
Modified:
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
---
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2009-04-21
13:51:19 UTC (rev 13728)
+++
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2009-04-21
14:13:21 UTC (rev 13729)
@@ -46,6 +46,7 @@
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.JSLiteral;
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.javascript.ScriptUtils;
@@ -320,6 +321,10 @@
Integer interval = new Integer(progressBar.getInterval());
options.put("pollId", clientId);
options.put("pollinterval", interval);
+ JSFunctionDefinition onsubmit = getUtils().getAsEventHandler(context, progressBar,
"onsubmit", "");
+ if (onsubmit != null) {
+ options.put("onsubmit", onsubmit);
+ }
if (progressBar.getAttributes().containsKey("ignoreDupResponses")) {
options.put("ignoreDupResponses", progressBar.getAttributes().get(
"ignoreDupResponses"));
@@ -441,7 +446,7 @@
"style",
variables.getVariable("style")
+ (!isAjaxMode ? "display: none" : ""));
- getUtils().encodePassThru(context, component);
+ getUtils().encodePassThruWithExclusions(context, component, "onsubmit");
encodeProgressBar(context, component, isSimple);
if (isAjaxMode) {
startScript(writer, 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 2009-04-21
13:51:19 UTC (rev 13728)
+++
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2009-04-21
14:13:21 UTC (rev 13729)
@@ -22,7 +22,10 @@
this.markup = markup;
this.options = options || {};
+ this.onbeforedomupdate = this.options.onbeforedomupdate;
+
this.options.onbeforedomupdate = function(request, event, data) {
+ if (this.onbeforedomupdate) this.onbeforedomupdate(request, event, data);
this.onComplete(data);
}.bind(this);