Author: pyaschenko
Date: 2009-11-24 10:31:22 -0500 (Tue, 24 Nov 2009)
New Revision: 15986
Modified:
root/examples/trunk/components/core-demo/pom.xml
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
ajax client library: richfaces.processRequestParams function was added
pom changes
Modified: root/examples/trunk/components/core-demo/pom.xml
===================================================================
--- root/examples/trunk/components/core-demo/pom.xml 2009-11-24 14:16:19 UTC (rev 15985)
+++ root/examples/trunk/components/core-demo/pom.xml 2009-11-24 15:31:22 UTC (rev 15986)
@@ -66,16 +66,6 @@
<version>1.5.8</version>
<scope>provided</scope>
</dependency>
-<dependency>
-<groupId>com.sun.faces</groupId>
-<artifactId>jsf-api</artifactId>
-<version>2.0.2-SNAPSHOT</version>
-</dependency>
-<dependency>
-<groupId>com.sun.faces</groupId>
-<artifactId>jsf-impl</artifactId>
-<version>2.0.2-SNAPSHOT</version>
-</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
---
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2009-11-24
14:16:19 UTC (rev 15985)
+++
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2009-11-24
15:31:22 UTC (rev 15986)
@@ -439,6 +439,58 @@
}
}());
+ // TODO:
+ richfaces.processRequestParams = function(source, options) {
+ options = options || {};
+ var sourceId = (typeof source == 'object' && source.id) ? source.id :
source;
+
+ parameters = options.parameters || {}; // TODO: change "parameters" to
"richfaces.ajax.params"
+ parameters.execute = "@component";
+ parameters.render = "@component";
+
+ if (!parameters.RICHFACES_AJAX) {
+ parameters.RICHFACES_AJAX = sourceId;
+ }
+
+ var eventHandlers;
+
+ for (var eventName in AJAX_EVENTS) {
+ var handler = createEventHandler(options[eventName]);
+
+ var serverHandler = AJAX_EVENTS[eventName];
+ if (serverHandler) {
+ handler = curry(serverHandler, handler);
+ }
+
+ if (handler) {
+ eventHandlers = eventHandlers || {};
+ eventHandlers[eventName] = handler;
+ }
+ }
+
+ if (options.status) {
+ var namedStatusEventHandler = function() {
setGlobalStatusNameVariable(options.status); };
+
+ //TODO add support for options.submit
+ eventHandlers = eventHandlers || {};
+ if (eventHandlers.begin) {
+ eventHandlers.begin = chain(namedStatusEventHandler, eventHandlers.begin);
+ } else {
+ eventHandlers.begin = namedStatusEventHandler;
+ }
+ }
+
+ parameters[sourceId] = sourceId;
+
+ if (eventHandlers) {
+ var eventsAdapter = richfaces.createJSFEventsAdapter(eventHandlers);
+ parameters['onevent'] = eventsAdapter;
+ parameters['onerror'] = eventsAdapter;
+ }
+
+ return parameters;
+ };
+
richfaces.ajax = function(source, event, options) {
options = options || {};
var sourceId = (typeof source == 'object' && source.id) ? source.id :
source;