Author: pyaschenko
Date: 2011-01-27 11:06:44 -0500 (Thu, 27 Jan 2011)
New Revision: 21284
Added:
trunk/examples/core-demo/src/main/webapp/status-myfaces.xhtml
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
http://jira.jboss.com/jira/browse/RF-9722
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2011-01-27 16:02:49
UTC (rev 21283)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2011-01-27 16:06:44
UTC (rev 21284)
@@ -376,13 +376,22 @@
// - success
// - error
// - complete
- handlers = handlers || {};
+ var handlers = handlers || {};
+ var ignoreSuccess;
return function(eventData) {
var source = eventData.source;
//that's request status, not status control data
var status = eventData.status;
var type = eventData.type;
+
+ if (type=='event' && status=='begin') {
+ ignoreSuccess = false;
+ } else if (type=='error') {
+ ignoreSuccess = true;
+ } else if (ignoreSuccess) {
+ return;
+ }
var typeHandlers = jsfEventsAdapterEventNames[type];
var handlerNames = (typeHandlers || {})[status] || typeHandlers;
@@ -407,7 +416,6 @@
event.componentData = componentData || {};
}
}
-
handler.call(source, event);
}
}
Added: trunk/examples/core-demo/src/main/webapp/status-myfaces.xhtml
===================================================================
--- trunk/examples/core-demo/src/main/webapp/status-myfaces.xhtml
(rev 0)
+++ trunk/examples/core-demo/src/main/webapp/status-myfaces.xhtml 2011-01-27 16:06:44 UTC
(rev 21284)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="http://richfaces.org/a4j">
+<f:view>
+ <h:head>
+ </h:head>
+ <h:body>
+
+ <a4j:status startStyle="color: green" errorStyle="color: red"
onstart="RichFaces.log.info('START')"
+ onerror="RichFaces.log.info('ERROR')"
onsuccess="RichFaces.log.info('SUCCESS')"
onstop="RichFaces.log.info('STOP')">
+ <f:facet name="start">...start...</f:facet>
+ <f:facet name="stop">stop</f:facet>
+ <f:facet name="error">error</f:facet>
+ </a4j:status>
+
+
+ <h:form>
+ <h:commandLink value="A4J:Ajax error"
action="#{statusBean.delayWithError}">
+ <a4j:ajax />
+ </h:commandLink>
+ <h:commandLink value="F:Ajax error"
action="#{statusBean.delayWithError}">
+ <f:ajax />
+ </h:commandLink>
+ </h:form>
+
+ <a4j:log />
+
+ </h:body>
+</f:view>
+</html>
\ No newline at end of file