Author: jjamrich
Date: 2011-10-25 11:34:47 -0400 (Tue, 25 Oct 2011)
New Revision: 22841
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml
Log:
RF-10994: Add example to simulate problem described in this JIRA
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java 2011-10-21
12:52:01 UTC (rev 22840)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java 2011-10-25
15:34:47 UTC (rev 22841)
@@ -35,8 +35,12 @@
import javax.faces.event.ComponentSystemEvent;
import org.richfaces.component.UITree;
+import org.richfaces.event.DropEvent;
import org.richfaces.tests.metamer.Attributes;
import org.richfaces.tests.metamer.bean.Model;
+import org.richfaces.tests.metamer.bean.RichBean;
+import org.richfaces.tests.metamer.model.drag.DragValue;
+import org.richfaces.tests.metamer.model.drag.DropValue;
import org.richfaces.tests.metamer.model.tree.CompactDisc;
import org.richfaces.tests.metamer.model.tree.CompactDiscXmlDescriptor;
import org.richfaces.tests.metamer.model.tree.Company;
@@ -144,6 +148,10 @@
}
return country;
}
+
+ public void processDragging(DropEvent dropEvent) {
+ RichBean.logToPage("* dropListener");
+ }
public List<NamedNode> getRoot() {
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml 2011-10-21
12:52:01 UTC (rev 22840)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml 2011-10-25
15:34:47 UTC (rev 22841)
@@ -38,6 +38,11 @@
<metamer:testPageLink id="treeAdaptors"
outcome="treeAdaptors" value="Tree Adaptors">
The <b>rich:tree</b> with declarative model using
<b>rich:treeModelRecursiveAdaptor</b> and
<b>rich:treeModelAdaptor</b>.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="rf-10994" outcome="rf-10994"
value="RF-10994">
+ The simple sample of <b>rich:tree</b> and
<b>DnD</b> simulation issue
+ <a
href="https://issues.jboss.org/browse/RF-10994"
target="_blank">RF-10994</a>
+ </metamer:testPageLink>
</ui:define>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml 2011-10-25
15:34:47 UTC (rev 22841)
@@ -0,0 +1,97 @@
+<?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:h="http://java.sun.com/jsf/html"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="rich:tree with DnD"
/>
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head">
+ <h:outputStylesheet library="css"
name="richDragAndDrop.css" />
+ </ui:define>
+
+ <ui:define name="component">
+
+ <h3><b>JIRA <a
href="https://issues.jboss.org/browse/RF-10994">RF-10994<...
simulation</b></h3>
+
+ <p><i>Tree by default using ajax mode. So when you expanding
nodes -leafs which getting loaded should be draggable.<br/>
+ But there is no draggable script resource so you could see JS errors instead
saying that Draggable si not a constructor.<br/>
+ If change toggleType to client - works fine.
+ If add any draggable component to the page - it also starts works as scripts
already inplace.
+ </i></p>
+
+ <rich:dragIndicator id="indicator" />
+
+ <p>
+ <rich:tree value="#{richTreeBean.root}"
nodeType="#{node.type}" var="node">
+
+ <rich:treeNode type="country" title="Country node type"
expanded="#{richTreeBean.expanded[node]}" >
+ <a4j:outputPanel layout="block">
+ <rich:dropTarget acceptedTypes="file"
dropListener="#{richTreeBean.processDragging}" />
+ <h:outputText value="#{node.name}" />
+ </a4j:outputPanel>
+ </rich:treeNode>
+
+ <rich:treeNode type="company" title="Company node type"
expanded="#{richTreeBean.expanded[node]}" >
+ <a4j:outputPanel layout="block">
+ <rich:dragSource type="file"
dragIndicator="indicator" />
+ <h:outputText value="#{node.name}" />
+ </a4j:outputPanel>
+ </rich:treeNode>
+
+ <rich:treeNode type="cd" title="CD node type"
expanded="#{richTreeBean.expanded[node]}" >
+ <a4j:outputPanel layout="block">
+ <h:outputText value="#{node.artist} -
#{node.title}" />
+ </a4j:outputPanel>
+ </rich:treeNode>
+
+ </rich:tree>
+ </p>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+
+ <fieldset>
+ <legend>DnD in rich:tree</legend>
+ <metamer:attributes value="#{richTreeBean.attributes}"
id="attributes" />
+ </fieldset>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file