Author: abelevich
Date: 2010-11-19 13:24:33 -0500 (Fri, 19 Nov 2010)
New Revision: 20127
Added:
sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/dnd.faces-config.xml
Modified:
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DragBehavior.java
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DropBehavior.java
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DragBehaviorRendererBase.java
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java
Log:
apply workaround for the
https://jira.jboss.org/browse/RF-9847
Modified:
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DragBehavior.java
===================================================================
---
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DragBehavior.java 2010-11-19
18:03:10 UTC (rev 20126)
+++
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DragBehavior.java 2010-11-19
18:24:33 UTC (rev 20127)
@@ -23,8 +23,11 @@
package org.richfaces.component.behavior;
+import javax.faces.render.RenderKitFactory;
+
import org.ajax4jsf.component.behavior.ClientBehavior;
import org.richfaces.cdk.annotations.JsfBehavior;
+import org.richfaces.cdk.annotations.JsfBehaviorRenderer;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
@@ -34,7 +37,7 @@
*/
@JsfBehavior(
- id = DragBehavior.BEHAVIOR_ID, tag = @Tag(name = "dragBehavior", handler =
"org.richfaces.view.facelets.html.CustomBehaviorHandler", type =
TagType.Facelets)
+ id = DragBehavior.BEHAVIOR_ID, renderer =
@JsfBehaviorRenderer(renderKitId=RenderKitFactory.HTML_BASIC_RENDER_KIT,
type=DropBehavior.BEHAVIOR_ID), tag = @Tag(name = "dragBehavior", handler =
"org.richfaces.view.facelets.html.CustomBehaviorHandler", type =
TagType.Facelets)
)
public class DragBehavior extends ClientBehavior {
@@ -44,4 +47,14 @@
public void setLiteralAttribute(String name, Object value) {
}
+
+ public String getEvent() {
+ return "mousedown";
+ }
+
+ @Override
+ public String getRendererType() {
+ return BEHAVIOR_ID;
+ }
+
}
Modified:
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DropBehavior.java
===================================================================
---
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DropBehavior.java 2010-11-19
18:03:10 UTC (rev 20126)
+++
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/component/behavior/DropBehavior.java 2010-11-19
18:24:33 UTC (rev 20127)
@@ -23,8 +23,10 @@
package org.richfaces.component.behavior;
+import javax.faces.render.RenderKitFactory;
import org.ajax4jsf.component.behavior.ClientBehavior;
import org.richfaces.cdk.annotations.JsfBehavior;
+import org.richfaces.cdk.annotations.JsfBehaviorRenderer;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
@@ -34,13 +36,18 @@
*/
@JsfBehavior(
- id = DropBehavior.BEHAVIOR_ID, tag = @Tag(name = "dropBehavior", handler =
"org.richfaces.view.facelets.html.CustomBehaviorHandler", type =
TagType.Facelets))
+ id = DropBehavior.BEHAVIOR_ID, renderer =
@JsfBehaviorRenderer(renderKitId=RenderKitFactory.HTML_BASIC_RENDER_KIT,
type=DropBehavior.BEHAVIOR_ID), tag = @Tag(name = "dropBehavior", handler =
"org.richfaces.view.facelets.html.CustomBehaviorHandler", type =
TagType.Facelets))
public class DropBehavior extends ClientBehavior {
public static final String BEHAVIOR_ID =
"org.richfaces.component.behavior.DropBehavior";
+
@Override
public void setLiteralAttribute(String name, Object value) {
}
+ @Override
+ public String getRendererType() {
+ return BEHAVIOR_ID;
+ }
}
Modified:
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DragBehaviorRendererBase.java
===================================================================
---
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DragBehaviorRendererBase.java 2010-11-19
18:03:10 UTC (rev 20126)
+++
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DragBehaviorRendererBase.java 2010-11-19
18:24:33 UTC (rev 20127)
@@ -24,13 +24,21 @@
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
+import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.render.ClientBehaviorRenderer;
+import javax.faces.render.RenderKitFactory;
+import org.richfaces.cdk.annotations.JsfBehaviorRenderer;
+import org.richfaces.component.behavior.DropBehavior;
+
/**
* @author abelevich
*
*/
+(a)JsfBehaviorRenderer(renderKitId=RenderKitFactory.HTML_BASIC_RENDER_KIT,
type=DropBehavior.BEHAVIOR_ID)
+
@ResourceDependencies({
@ResourceDependency(name = "jquery.js"),
@ResourceDependency(name = "jquery-ui-core.js"),
@@ -39,5 +47,8 @@
@ResourceDependency(name = "richfaces-dnd.js")
})
public class DragBehaviorRendererBase extends ClientBehaviorRenderer {
-
+ @Override
+ public String getScript(ClientBehaviorContext behaviorContext, ClientBehavior
behavior) {
+ return "DragBehavior encoded";
+ }
}
Modified:
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java
===================================================================
---
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java 2010-11-19
18:03:10 UTC (rev 20126)
+++
sandbox/trunk/ui/drag-drop/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java 2010-11-19
18:24:33 UTC (rev 20127)
@@ -24,6 +24,8 @@
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
+import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.render.ClientBehaviorRenderer;
/**
@@ -39,4 +41,11 @@
@ResourceDependency(name = "richfaces-dnd.js")
})
public class DropBehaviorRendererBase extends ClientBehaviorRenderer {
+
+ @Override
+ public String getScript(ClientBehaviorContext behaviorContext, ClientBehavior
behavior) {
+ return "DropBehavior encoded";
+ }
+
+
}
Added: sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/dnd.faces-config.xml
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/dnd.faces-config.xml
(rev 0)
+++
sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/dnd.faces-config.xml 2010-11-19
18:24:33 UTC (rev 20127)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<faces-config version="2.0" metadata-complete="false"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <behavior>
+ <description> @author abelevich
+
+</description>
+ <behavior-id>org.richfaces.component.behavior.DropBehavior</behavior-id>
+ <behavior-class>org.richfaces.component.behavior.DropBehavior</behavior-class>
+ <behavior-extension>
+ <cdk:base-class>org.richfaces.component.behavior.DropBehavior
+ </cdk:base-class>
+ <cdk:generate>false</cdk:generate>
+ </behavior-extension>
+ </behavior>
+ <behavior>
+ <description> @author abelevich
+
+</description>
+ <behavior-id>org.richfaces.component.behavior.DragBehavior</behavior-id>
+ <behavior-class>org.richfaces.component.behavior.DragBehavior</behavior-class>
+ <behavior-extension>
+ <cdk:base-class>org.richfaces.component.behavior.DragBehavior
+ </cdk:base-class>
+ <cdk:generate>false</cdk:generate>
+ </behavior-extension>
+ </behavior>
+
+ <render-kit>
+ <render-kit-id>HTML_BASIC</render-kit-id>
+ <client-behavior-renderer>
+ <client-behavior-renderer-type>org.richfaces.component.behavior.DropBehavior</client-behavior-renderer-type>
+ <client-behavior-renderer-class>org.richfaces.renderkit.DropBehaviorRendererBase</client-behavior-renderer-class>
+ </client-behavior-renderer>
+ <client-behavior-renderer>
+ <client-behavior-renderer-type>org.richfaces.component.behavior.DragBehavior</client-behavior-renderer-type>
+ <client-behavior-renderer-class>org.richfaces.renderkit.DragBehaviorRendererBase</client-behavior-renderer-class>
+ </client-behavior-renderer>
+ </render-kit>
+
+ <faces-config-extension>
+ <cdk:prefix>org.richfaces.component</cdk:prefix>
+ <cdk:taglib>
+ <cdk:shortName>dnd</cdk:shortName>
+ <
cdk:uri>http://richfaces.org/dnd</cdk:uri>
+ </cdk:taglib>
+ </faces-config-extension>
+
+</faces-config>