Author: nbelaevski
Date: 2010-07-11 20:57:52 -0400 (Sun, 11 Jul 2010)
New Revision: 17935
Modified:
root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
Removed overriding of client-side AJAX events by server-side ones
Modified:
root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
---
root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2010-07-11
23:13:32 UTC (rev 17934)
+++
root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2010-07-12
00:57:52 UTC (rev 17935)
@@ -154,18 +154,6 @@
return behavior.getOnbegin();
}
},
- beforedomupdate {
- @Override
- public String getAttributeValue(AjaxClientBehavior behavior) {
- return behavior.getOnbeforedomupdate();
- }
- },
- complete {
- @Override
- public String getAttributeValue(AjaxClientBehavior behavior) {
- return behavior.getOncomplete();
- }
- },
error {
@Override
public String getAttributeValue(AjaxClientBehavior behavior) {
@@ -188,29 +176,6 @@
public abstract String getAttributeValue(AjaxClientBehavior behavior);
}
- private static enum EventOptionsData {
- begin {
- @Override
- public String getAttributeValue(UIComponent component) {
- return getAjaxOnBegin(component);
- }
- },
- beforedomupdate {
- @Override
- public String getAttributeValue(UIComponent component) {
- return getAjaxOnBeforeDomUpdate(component);
- }
- },
- complete {
- @Override
- public String getAttributeValue(UIComponent component) {
- return getAjaxOncomplete(component);
- }
- };
-
- public abstract String getAttributeValue(UIComponent component);
- }
-
/**
* Build JavaScript onclick event for given component
*
@@ -346,19 +311,17 @@
private static void appendComponentOptions(FacesContext facesContext, UIComponent
component,
AjaxEventOptions ajaxEventOptions) {
- for (EventOptionsData eventOptionsData : EventOptionsData.values()) {
- String behaviorName = eventOptionsData.toString();
- HandlersChain handlersChain = new HandlersChain(component);
- String inlineHandler = eventOptionsData.getAttributeValue(component);
+ String behaviorName = "begin";
+ HandlersChain handlersChain = new HandlersChain(component);
+ String inlineHandler = getAjaxOnBegin(component);
- handlersChain.addInlineHandlerAsValue(facesContext, inlineHandler);
- handlersChain.addBehaviors(facesContext, behaviorName);
+ handlersChain.addInlineHandlerAsValue(facesContext, inlineHandler);
+ handlersChain.addBehaviors(facesContext, behaviorName);
- String handlerScript = handlersChain.toScript();
+ String handlerScript = handlersChain.toScript();
- if (isNotEmpty(handlerScript)) {
- ajaxEventOptions.set(behaviorName, handlerScript);
- }
+ if (isNotEmpty(handlerScript)) {
+ ajaxEventOptions.set(behaviorName, handlerScript);
}
ajaxEventOptions.set("incId", "1");
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-07-11
23:13:32 UTC (rev 17934)
+++ root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-07-12
00:57:52 UTC (rev 17935)
@@ -546,10 +546,12 @@
}
}
+ if (clientHandler) {
+ clientHandler.call(window, event, data);
+ }
+
if (serverHandler) {
serverHandler.call(window, event, data);
- } else if (clientHandler) {
- clientHandler.call(window, event, data);
}
};
Show replies by date