Author: nbelaevski
Date: 2010-10-27 12:56:42 -0400 (Wed, 27 Oct 2010)
New Revision: 19709
Added:
branches/RF-7817/push-redesign/richfaces-suppressions.xml
Removed:
branches/RF-7817/push-redesign/checkstyle-suppressions.xml
Modified:
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces-event.js
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces.js
branches/RF-7817/push-redesign-app/src/main/java/demo/ChannelsBean.java
branches/RF-7817/push-redesign-app/src/main/webapp/chat.xhtml
branches/RF-7817/push-redesign/pom.xml
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js
Log:
https://jira.jboss.org/browse/RF-7817
Modified:
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
---
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-10-27
16:50:39 UTC (rev 19708)
+++
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-10-27
16:56:42 UTC (rev 19709)
@@ -228,8 +228,11 @@
source = source || this.id;
var element = richfaces.getDomElement(source);
if (element) {
- element["richfaces"] = element["richfaces"] || {};
- element.richfaces.component = this;
+ element[richfaces.RICH_CONTAINER] = $.extend(element[richfaces.RICH_CONTAINER] ||
{},
+ {
+ component:this
+ }
+ );
}
return element;
},
Modified:
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces-event.js
===================================================================
---
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces-event.js 2010-10-27
16:50:39 UTC (rev 19708)
+++
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces-event.js 2010-10-27
16:56:42 UTC (rev 19709)
@@ -32,6 +32,9 @@
var getHandlerWrapper = function (component, fn) {
return function (e,d){
+ if (!e[richfaces.RICH_CONTAINER]) {
+ e[richfaces.RICH_CONTAINER] = {data: d};
+ }
return fn.call(component||this, e, this, d);
};
}
@@ -222,7 +225,7 @@
* */
fire : function(selector, eventType, data) {
var event = $.Event(eventType);
- getEventElement(selector).trigger(eventType, data);
+ getEventElement(selector).trigger(event, data);
return !event.isDefaultPrevented();
},
Modified: branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
---
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-10-27
16:50:39 UTC (rev 19708)
+++
branches/RF-7817/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-10-27
16:56:42 UTC (rev 19709)
@@ -13,6 +13,8 @@
(function(jQuery, richfaces) {
+ richfaces.RICH_CONTAINER = "rf";
+
// get DOM element by id or DOM element or jQuery object
richfaces.getDomElement = function (source) {
var type = typeof source;
@@ -38,7 +40,7 @@
var element = richfaces.getDomElement(source);
if (element) {
- return (element["richfaces"] || {})["component"];
+ return (element[richfaces.RICH_CONTAINER] || {})["component"];
}
}
Deleted: branches/RF-7817/push-redesign/checkstyle-suppressions.xml
===================================================================
--- branches/RF-7817/push-redesign/checkstyle-suppressions.xml 2010-10-27 16:50:39 UTC
(rev 19708)
+++ branches/RF-7817/push-redesign/checkstyle-suppressions.xml 2010-10-27 16:56:42 UTC
(rev 19709)
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE suppressions PUBLIC
- "-//Puppy Crawl//DTD Suppressions 1.0//EN"
- "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
-
-<!-- NOTE: Because of issues with maven checkstyle plugin each suppression
- file must have all suppressions defined.
-
- See RF-9077 for details. -->
-<suppressions>
- <suppress checks="DoubleCheckedLocking"
files="MultipartRequestRegistry.java" />
- <suppress checks="FallThrough" files="JSMin.java" />
- <suppress checks="IllegalCatch" files="UISwitchablePanel.java"
/>
- <suppress checks="ModifiedControlVariable"
files="MultipartRequest.java" />
- <suppress checks="IllegalCatch" files="StagingServer.java"
/>
- <suppress checks="IllegalCatch"
files="PartialViewContextImpl.java" />
- <suppress checks="FallThrough" files="StagingServer.java"
/>
- <suppress checks="ModifiedControlVariable" files="Cookie.java"
/>
- <suppress checks="IllegalCatch" files="CacheManager.java"
/>
- <suppress checks="MissingSwitchDefault"
files="JSONTokener.java" />
- <suppress checks="IllegalCatch" files="AjaxViewRoot.java"
/>
- <suppress checks="FallThrough" files="XMLTokener.java" />
- <suppress checks="IllegalCatch"
files="ResourceHandlerImpl.java" />
- <suppress checks="IllegalThrows"
files="AbstractThreadedTest.java" />
- <suppress checks="ModifiedControlVariable"
files="URLCodec.java" />
-
- <!-- TODO it is hot fix for building process, this files belong to the test-base
module,
- and must be removed from here -->
- <suppress checks="IllegalCatch"
files="AbstractThreadedTest.java" />
- <suppress checks="IllegalCatch" files="StagingServer.java"
/>
-
- <!-- TODO it is hot fix for building process, this files belong to the
ui/output/trunk/panela/ui module,
- and must be removed from here -->
- <suppress checks="IllegalCatch"
files="AbstractTogglePanel.java" />
-
- <!-- TODO it is hot fix for building process, this files belong to the
push-redesign module,
- and must be removed from here -->
- <suppress checks="IllegalCatch" files="AbstractRequest.java"
/>
-</suppressions>
Modified: branches/RF-7817/push-redesign/pom.xml
===================================================================
--- branches/RF-7817/push-redesign/pom.xml 2010-10-27 16:50:39 UTC (rev 19708)
+++ branches/RF-7817/push-redesign/pom.xml 2010-10-27 16:56:42 UTC (rev 19709)
@@ -24,7 +24,7 @@
<!-- Checkstyle only required here because suppressions needed -->
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
-
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
+
<suppressionsLocation>${project.basedir}/richfaces-suppressions.xml</suppressionsLocation>
</configuration>
</plugin>
<plugin>
Added: branches/RF-7817/push-redesign/richfaces-suppressions.xml
===================================================================
--- branches/RF-7817/push-redesign/richfaces-suppressions.xml (rev
0)
+++ branches/RF-7817/push-redesign/richfaces-suppressions.xml 2010-10-27 16:56:42 UTC (rev
19709)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE suppressions PUBLIC
+ "-//Puppy Crawl//DTD Suppressions 1.0//EN"
+ "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
+
+<suppressions>
+ <suppress checks="IllegalCatch" files="AbstractRequest.java"
/>
+</suppressions>
Modified:
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js
===================================================================
---
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js 2010-10-27
16:50:39 UTC (rev 19708)
+++
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js 2010-10-27
16:56:42 UTC (rev 19709)
@@ -23,16 +23,20 @@
var COMPONENT_NAME = "Push";
- var DATA_EVENT_NAME = COMPONENT_NAME + richfaces.Event.EVENT_NAMESPACE_SEPARATOR +
'dataAvailable';
+ var RICH_NAMESPACE = richfaces.Event.RICH_NAMESPACE;
+
+ var EVENT_NAMESPACE_SEPARATOR = richfaces.Event.EVENT_NAMESPACE_SEPARATOR;
+
+ var DATA_EVENT_NAME = 'dataAvailable' + EVENT_NAMESPACE_SEPARATOR +
RICH_NAMESPACE + EVENT_NAMESPACE_SEPARATOR + COMPONENT_NAME;
- var ERROR_EVENT_NAME = COMPONENT_NAME + richfaces.Event.EVENT_NAMESPACE_SEPARATOR +
'error';
+ var ERROR_EVENT_NAME = 'error' + EVENT_NAMESPACE_SEPARATOR + RICH_NAMESPACE +
EVENT_NAMESPACE_SEPARATOR + COMPONENT_NAME;
var getDataEventNamespace = function(address) {
- return richfaces.Event.createNamespace(DATA_EVENT_NAME, address);
+ return DATA_EVENT_NAME + EVENT_NAMESPACE_SEPARATOR + address;
};
var getErrorEventNamespace = function(address) {
- return richfaces.Event.createNamespace(ERROR_EVENT_NAME, address);
+ return ERROR_EVENT_NAME + EVENT_NAMESPACE_SEPARATOR + address;
};
richfaces.Push = (function() {
@@ -196,7 +200,7 @@
__bindDataHandler: function(handlerCode) {
var ns = getDataEventNamespace(this.__address)
- this.__handlers.data = richfaces.Event.bind(document, ns, new
Function("event", "object", "data", handlerCode));
+ this.__handlers.data = richfaces.Event.bind(document, ns, new
Function("event", handlerCode));
},
__unbindDataHandler: function() {
@@ -210,7 +214,7 @@
__bindErrorHandler: function(handlerCode) {
var ns = getErrorEventNamespace(this.__address);
- this.__handlers.error = richfaces.Event.bind(document, ns, new
Function("event", "object", "data", handlerCode));
+ this.__handlers.error = richfaces.Event.bind(document, ns, new
Function("event", handlerCode));
},
__unbindErrorHandler: function() {
Modified: branches/RF-7817/push-redesign-app/src/main/java/demo/ChannelsBean.java
===================================================================
--- branches/RF-7817/push-redesign-app/src/main/java/demo/ChannelsBean.java 2010-10-27
16:50:39 UTC (rev 19708)
+++ branches/RF-7817/push-redesign-app/src/main/java/demo/ChannelsBean.java 2010-10-27
16:56:42 UTC (rev 19709)
@@ -21,6 +21,7 @@
*/
package demo;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -33,8 +34,10 @@
*/
@SessionScoped
@ManagedBean
-public class ChannelsBean {
+public class ChannelsBean implements Serializable {
+ private static final long serialVersionUID = 2916670958555985564L;
+
private List<Channel> channels = new ArrayList<Channel>();
public ChannelsBean() {
Modified: branches/RF-7817/push-redesign-app/src/main/webapp/chat.xhtml
===================================================================
--- branches/RF-7817/push-redesign-app/src/main/webapp/chat.xhtml 2010-10-27 16:50:39 UTC
(rev 19708)
+++ branches/RF-7817/push-redesign-app/src/main/webapp/chat.xhtml 2010-10-27 16:56:42 UTC
(rev 19709)
@@ -53,7 +53,7 @@
</h:selectBooleanCheckbox>
<h:panelGroup layout="block"
rendered="#{channel.rendered}">
- <p:push address="#{channelName}@chat" onerror="alert(data)"
ondataavailable="jQuery('<div
/>').prependTo('.#{channelName}Output').text(data)" />
+ <p:push address="#{channelName}@chat"
onerror="alert(event.rf.data)" ondataavailable="jQuery('<div
/>').prependTo('.#{channelName}Output').text(event.rf.data)"
/>
<h:inputText styleClass="messageInput"
value="#{chatBean.message}" size="40" />